Dev #127

Merged
altavir merged 214 commits from dev into master 2020-08-11 08:33:21 +03:00
Showing only changes of commit 186575d8b3 - Show all commits

View File

@ -14,6 +14,7 @@ object JBigIntegerField : Field<BigInteger> {
override val one: BigInteger override val one: BigInteger
get() = BigInteger.ONE get() = BigInteger.ONE
override fun number(value: Number): BigInteger = BigInteger.valueOf(value.toLong())
override fun divide(a: BigInteger, b: BigInteger): BigInteger = a.div(b) override fun divide(a: BigInteger, b: BigInteger): BigInteger = a.div(b)
override fun add(a: BigInteger, b: BigInteger): BigInteger = a.add(b) override fun add(a: BigInteger, b: BigInteger): BigInteger = a.add(b)
override fun BigInteger.minus(b: BigInteger): BigInteger = this.subtract(b) override fun BigInteger.minus(b: BigInteger): BigInteger = this.subtract(b)
@ -35,9 +36,8 @@ abstract class JBigDecimalFieldBase internal constructor(val mathContext: MathCo
get() = BigDecimal.ONE get() = BigDecimal.ONE
override fun add(a: BigDecimal, b: BigDecimal): BigDecimal = a.add(b) override fun add(a: BigDecimal, b: BigDecimal): BigDecimal = a.add(b)
override fun BigDecimal.minus(b: BigDecimal): BigDecimal { override fun BigDecimal.minus(b: BigDecimal): BigDecimal = subtract(b)
return subtract(b) override fun number(value: Number): BigDecimal = BigDecimal.valueOf(value.toDouble())
}
override fun multiply(a: BigDecimal, k: Number): BigDecimal = override fun multiply(a: BigDecimal, k: Number): BigDecimal =
a.multiply(k.toDouble().toBigDecimal(mathContext), mathContext) a.multiply(k.toDouble().toBigDecimal(mathContext), mathContext)