Describe the bug
Exponentiating a zero BigDecimal by any negative long yields division by zero.
To Reproduce
Run the following code:
val a = 0.0.toBigDecimal(decimalMode = DecimalMode(6L, RoundingMode.CEILING, -1L))
val b = (-1.0).toBigDecimal(decimalMode = DecimalMode(6L, RoundingMode.CEILING, -1L))
a.pow(b.longValue(false)) // Division by zero
Expected behavior
Throw a more concise exception, explaining that the negative exponentiation of zero is not defined.
Describe the bug Exponentiating a zero BigDecimal by any negative long yields division by zero.
To Reproduce Run the following code:
Expected behavior Throw a more concise exception, explaining that the negative exponentiation of zero is not defined.
Platform