From 1614eef4526066dcab71220db2929f19f32fe5f9 Mon Sep 17 00:00:00 2001 From: Iaroslav Date: Sun, 28 Jun 2020 22:10:39 +0700 Subject: [PATCH] Revert change of JBigIntegerField to Ring, delete unused psvm function --- .../kotlin/scientifik/kmath/operations/BigNumbers.kt | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kmath-core/src/jvmMain/kotlin/scientifik/kmath/operations/BigNumbers.kt b/kmath-core/src/jvmMain/kotlin/scientifik/kmath/operations/BigNumbers.kt index 1c1c0a5bf..32feeb0d1 100644 --- a/kmath-core/src/jvmMain/kotlin/scientifik/kmath/operations/BigNumbers.kt +++ b/kmath-core/src/jvmMain/kotlin/scientifik/kmath/operations/BigNumbers.kt @@ -7,13 +7,14 @@ import java.math.MathContext /** * A field wrapper for Java [BigInteger] */ -object JBigIntegerRing : Ring, PowerOperations { +object JBigIntegerField : Field, PowerOperations { override val zero: BigInteger get() = BigInteger.ZERO override val one: BigInteger get() = BigInteger.ONE + override fun divide(a: BigInteger, b: BigInteger): BigInteger = a.div(b) override fun add(a: BigInteger, b: BigInteger): BigInteger = a.add(b) override fun BigInteger.minus(b: BigInteger): BigInteger = this.subtract(b) override fun multiply(a: BigInteger, k: Number): BigInteger = a.multiply(k.toInt().toBigInteger()) @@ -54,7 +55,3 @@ abstract class JBigDecimalFieldBase internal constructor(val mathContext: MathCo class JBigDecimalField(mathContext: MathContext = MathContext.DECIMAL64) : JBigDecimalFieldBase(mathContext) { companion object : JBigDecimalFieldBase() } - -fun main() { - JBigDecimalField { one pow 2 } -}