Skip to the content.

Release 1.2.1

API changes

No API changes.

Bugfixes

BigDecimalMath.isDoubleValue() to return true for values abs(x) < Double.MIN_VALUE

Fixed isDoubleValue() to return true for values abs(x) < Double.MIN_VALUE.

For example BigDecimalMath.isDoubleValue(new BigDecimal("1E-325")) will return true although this value is smaller than Double.MIN_VALUE (and therefore outside the range of values that can be represented as double) because new BigDecimal("1E-325").doubleValue() returns 0 which is a legal value with loss of precision.

Enhancements

BigFloat.equals() tests mathematical identity, not technical

One of the most common problem for programmers using BigDecimal is probably that BigDecimal.equals() tests for technical identity, not mathematical identity (the common workaround is to use compareTo() instead).

BigFloat.equals() tests for mathematical identity. For example BigFloat.context(100).valueOf(123).equals(BigFloat.context(10).valueOf(123)) returns true.

Examples

Note: The example code is available on github, but not part of the big-math library.

No changes in the examples.