ionspin / kotlin-multiplatform-bignum

A Kotlin multiplatform library for arbitrary precision arithmetics
Apache License 2.0
355 stars 41 forks source link

BigDecimal.round(...) method returns unexpected result #72

Closed ionspin closed 4 years ago

ionspin commented 4 years ago

Describe the bug BigDecimal round() method provides unexpected result when exponent is negative

To Reproduce 0.000001234 with decimal mode 2, CEILING will become 0.0000013, instead of expected 0.01

Additional context Might be prudent to rething how default decimal mode is applied in regard to rounding in operations