[DGD] Perfect dump of float
Carter Cheng
cartercheng at gmail.com
Fri May 27 09:25:52 CEST 2011
I am no longer too familiar with the details of the dgd source code
but I suspect you could (if bitwise operators dont operate on the
float type) write some sort of function to do this. Another idea is to
make bitwise operations operate on floats (if these do not work
already). This should make it possible to do this with a series of
shift and mask operations.
On Fri, May 27, 2011 at 2:42 PM, Shentino <shentino at gmail.com> wrote:
> Since it's not possible to access the raw bit pattern, I was curious.how one
> might dump a perfect representation of a float that doesn't result in even
> one bit of data to be lost.
>
> My guess is that one would need to do some sort of ldexp to split the
> mantissa and exponent apart, then use float.h for information on how many
> fraction bits to extract from the mantissa for dumping out as hex.
>
> Any hidden gotchas I need to be aware of?
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>
More information about the DGD
mailing list