If you call FloatingPoint.valueOf(double) with negative values, you get an
java.lang.ArithmeticException: Negative number or zero .
Solution: in FloatingPoint.valueOf(double) the line
int e = MathLib.floorLog10(doubleValue) - 18 + 1; // 18 digits significand.
should be replaced with
int e = MathLib.floorLog10(MathLib.abs(doubleValue)) - 18 + 1; // 18 digits
(This has a different cause from Issue 113 and I have already a solution, so I'm
submitting this separately.)
I would also suggest adding the lines
if (doubleValue == 1.0)
to this function.