I have a 64-bit long
containing an IEEE 754 representation of a double
. I'd like to convert it to a string just like the standard Java Double.toString(d)
does. However, I can't use any of the methods of the Double
class, because they are buggy. (String.valueOf(d)
and "" + d
don't work either, because they use Double.toString(d)
internally. NumberFormat
doesn't work, because it loses precision.) So I need pure Java code which would do the conversion.
Where can I find such code? I tried the source code of GNU Classpath, but it uses a native method for this conversion.