diff --git a/CHANGELOG.md b/CHANGELOG.md index c2792624..b3ec2a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ ## Descriptive changelog (All dates are DD.MM.YYYY) -##### 0.1.6-SNAPSHOT +##### 0.2.0 - 18.8.2020 - Improvements, optimizations, bugfixes and Kotlin 1.4.0 +- Impeovement #122 Add "scale" support to BigDecimal +- Fixed #118 Rounding issue on division +- Improvement #116 Introduce local gradle varibale to enable JVM target on different platforms +- Fixed #112 BigDecimal divideAndRemainder bad result +- Fixed #111 - BigDecimal narrowing +- Fixed #104 - BigInteger.toByteArray should prefer ByteArray over Array +- Fixed #103 - Removed coroutines +- Fixed #90 - Incorrect Result From Negative Double +- Fixed #88 - BigInteger.bitAt does not work correctly - Fixed #86 - Rounding fails when integer part is 9 - Fixed #88 - BigInteger.bitAt() returns invalid value - Built with Kotlin 1.4-M3 diff --git a/README.md b/README.md index 1b16b946..f3f48291 100644 --- a/README.md +++ b/README.md @@ -414,6 +414,20 @@ data class DecimalMode(val decimalPrecision : Long = 0, val roundingMode : Round * If two `BigDecimal`s have different `DecimalModes` with different RoundingModes an `ArithmeticException` will be thrown. If the modes are same, but the precision is different, larger precision will be used. +### Scale + +Scale, or the number of digits to the right of the decimal, can also be specified. Default is no +scale, which puts no restriction on number of digits to the right of the decimal. When scale is +specified, a `RoundingMode` other than `RoundingMode.NONE` is also required. +When arithmetic operations have both operands unlimited precision and no scaling, the result is +also unlimited precision and no scale. When an operation mixes an unlimited precision operand +and a scaled operand, the result is unlimited precision. WHen both operands have scale, +whether unlimited precision or limited precision, then these rules for scale of the result are used: + +* add, subtract - max of the two scales +* multiply - sum of the two scales +* divide - min of the two scales + ##### Infinite precision Precision 0 and roundingMode none attempt to provide infinite precisions. Exception is division, where default precision is diff --git a/THANKS.md b/THANKS.md new file mode 100644 index 00000000..c8facd9f --- /dev/null +++ b/THANKS.md @@ -0,0 +1,3 @@ +Special thanks to people for contributing to the library: + +- Steven K Olson (@skolson) diff --git a/bignum/build.gradle.kts b/bignum/build.gradle.kts index f8ba6a84..898d4f45 100644 --- a/bignum/build.gradle.kts +++ b/bignum/build.gradle.kts @@ -66,7 +66,7 @@ repositories { jcenter() } group = "com.ionspin.kotlin" -version = "0.1.6-1.4.0-rc-SNAPSHOT" +version = "0.2.0" val ideaActive = System.getProperty("idea.active") == "true" diff --git a/buildSrc/src/main/kotlin/Deps.kt b/buildSrc/src/main/kotlin/Deps.kt index c426394d..8e2ebc73 100644 --- a/buildSrc/src/main/kotlin/Deps.kt +++ b/buildSrc/src/main/kotlin/Deps.kt @@ -16,9 +16,9 @@ */ object Versions { - val kotlinCoroutines = "1.3.8-1.4.0-rc" - val kotlin = "1.4.0-rc" - val kotlinSerialization = "1.0-M1-1.4.0-rc" + val kotlinCoroutines = "1.3.9" + val kotlin = "1.4.0" + val kotlinSerialization = "1.0.0-RC" val nodePlugin = "1.3.0" val dokkaPlugin = "1.4.0-rc" }