[DGD] Perfect dump of float

Shentino shentino at gmail.com
Fri May 27 08:42:21 CEST 2011


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?



More information about the DGD mailing list