Hi guys,
I've been looking everywhere to find something about the problem below but can't find anything. As always, you are my last help
Here's - in two lines - what I'm trying to do:
1. The user enters a decimal value (e.g. 2.1)
2. The conversion function should return the hexadecimal floating point value for this (in this example 40066666).
The following website:
http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html
does this for me, but I need it in C so I can integrate it in one of my programs.
I know there's a lot of websites that explain the theory of this conversion and I think I should be able to make it myself (not knowing how long it would take me). I'm pretty sure though, that the source code for this conversion should be available somewhere (or maybe it's even a standard function in some header file?) and that could save me a lot of time.
Therefore my question: does anyone know where I can find a C program (source code) that does the above conversion for me? Please note, this is not lazyness... people seem to have graduated only on doing this conversion.
Any help would be appreciated. Thanks very much in advance,
René