Basically, I'm curious on how to get hold of new BigDecimal(Double.toString(d))
without going through the process of creating a string.
The documentation for Double.toString
is quite complex (and interesting). As I understand it, the method does not actually return the string representation of the number actually represented by the given double, but the string representation of the (near by) shortest real number that uniquely identifies the given double.
(I don't actually need this. If I did, I'd probably go through a string anyway. I'm just curious about this algorithm that finds this "short" real number that uniquely determines the given double value.)
(This is a follow-up question on this question.)