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 } -}