The binary format should not change - this, of course, will be a violation of existing specifications. It is defined in the IEEE754 / IEC 60559: 1989 format, as Jimmy said. (Section 1.3 of the C # 3.0 Language Specifications, Section 8.2.2 of ECMA 335). The code in DoubleConverter must be accurate and reliable.
For future reference, the corresponding code bit in the example:
public static string ToExactString (double d) { …
I liked the comments at the time, but I'm sure I will have to think about it now. After the first part, you have a raw exponent and a mantissa - the rest of the code just helps to treat them more simply.
Jon Skeet Dec 23 '08 at 21:03 2008-12-23 21:03
source share