Closed theisenp closed 2 years ago
Thanks for reporting and for providing additional context, it helps a lot!
@theisenp fix should be available in an half an hour or so when CI/CD finishes the build. It will be in snapshot version 0.3.4-SNAPSHOT. Once again, thanks for reporting!
Awesome, thanks for the quick fix!
Describe the bug Calling
BigDecimal.divideAndRemainder
throws an exception when the exponent is-1
and no explicitDecimalMode
has been provided.To Reproduce This statement:
Throws an exception with a stacktrace like this:
Expected behavior No exception, correct division/remainder result.
Platform
Additional context The method creates a default decimal mode if none has been set on the dividend:
So when the exponent is
-1
, the precision resolves to0
, which is reserved for unlimited precision and can't be paired withRoundingMode.FLOOR
.divideAndRemainder
is the root cause, but many other methods use it to compute their results and so are also affected (e.g.remainder
,isWholeNumber
, etc).