Closed mihbor closed 2 years ago
Describe the bug https://github.com/ionspin/kotlin-multiplatform-bignum/blob/main/bignum/src/commonMain/kotlin/com/ionspin/kotlin/bignum/decimal/BigDecimal.kt#L1445
fun floor(): BigDecimal { return roundSignificand(DecimalMode(exponent + 1, RoundingMode.FLOOR)) }
but DecimalMode doesn't accept neither 0 (with roundingMode != RoundingMode.NONE) nor negative precision.
To Reproduce Steps to reproduce the behavior: call floor() on a BigDecimal with negative exponent
Expected behavior A clear and concise description of what you expected to happen.
Platform JS
If JS (please complete the following information): chrome
Additional context bignum version 0.3.4
A workaround is to instead call roundToDigitPositionAfterDecimalPoint(0, RoundingMode.FLOOR)
roundToDigitPositionAfterDecimalPoint(0, RoundingMode.FLOOR)
Thanks for reporting!
Describe the bug https://github.com/ionspin/kotlin-multiplatform-bignum/blob/main/bignum/src/commonMain/kotlin/com/ionspin/kotlin/bignum/decimal/BigDecimal.kt#L1445
but DecimalMode doesn't accept neither 0 (with roundingMode != RoundingMode.NONE) nor negative precision.
To Reproduce Steps to reproduce the behavior: call floor() on a BigDecimal with negative exponent
Expected behavior A clear and concise description of what you expected to happen.
Platform JS
If JS (please complete the following information): chrome
Additional context bignum version 0.3.4