From e6fb8bfc52b33b4e4b1ec01ac4d08c1e6a539938 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Sun, 13 Sep 2020 17:05:34 +0700 Subject: [PATCH] Change rounding to match the one from Java --- .../kotlin/scientifik/kmath/bignum/BigDecimalField.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmath-bignum/src/commonMain/kotlin/scientifik/kmath/bignum/BigDecimalField.kt b/kmath-bignum/src/commonMain/kotlin/scientifik/kmath/bignum/BigDecimalField.kt index ddca93dd7..c29c2a8b1 100644 --- a/kmath-bignum/src/commonMain/kotlin/scientifik/kmath/bignum/BigDecimalField.kt +++ b/kmath-bignum/src/commonMain/kotlin/scientifik/kmath/bignum/BigDecimalField.kt @@ -25,7 +25,7 @@ abstract class BigDecimalFieldBase internal constructor(val mode: DecimalMode = override fun BigDecimal.div(k: Number): BigDecimal = divide(number(k), mode) companion object { - internal val DEFAULT_MODE = DecimalMode(16, RoundingMode.ROUND_HALF_AWAY_FROM_ZERO) + internal val DEFAULT_MODE = DecimalMode(16, RoundingMode.ROUND_HALF_TOWARDS_ZERO) } }