ionspin / kotlin-multiplatform-bignum

A Kotlin multiplatform library for arbitrary precision arithmetics
Apache License 2.0
339 stars 40 forks source link

Fix round to even when exponent is less than 0 #278

Closed ionspin closed 5 months ago

ionspin commented 5 months ago

When using round to even rounding, and exponent is less than 0, invalid result was provided because adding one signum caused rounding to behave as round up. Fixed by adding 2 * signum when round to even is used. Fixes #277.