A DESCRIPTION OF THE PROBLEM :
I find the following slow path in BigDecimal:
// Somewhat inefficient, but guaranteed to work.
return Double.parseDouble(this.toString())
SinceJDK-7131192 : BigInteger.doubleValue() is depressingly slow
is now available, something faster could be done.
It suggest doing unscaledValue().doubleValue() * Math.exp(scale()*Math.log(10))
I find the following slow path in BigDecimal:
// Somewhat inefficient, but guaranteed to work.
return Double.parseDouble(this.toString())
Since
is now available, something faster could be done.
It suggest doing unscaledValue().doubleValue() * Math.exp(scale()*Math.log(10))
- relates to
-
JDK-8202555 Double.toString(double) sometimes produces incorrect results
-
- Closed
-