diff options
author | Paul Phillips <paulp@improving.org> | 2011-09-28 21:52:22 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-09-28 21:52:22 +0000 |
commit | 3a1332c451c8bd9b987ab3dbe775ef5a08360705 (patch) | |
tree | f77b78b14b327cdc18018d0bfaeb28f63cea891f /src/library | |
parent | 82eb1aa430195648b6fe80f67c45c741884dc2d7 (diff) | |
download | scala-3a1332c451c8bd9b987ab3dbe775ef5a08360705.tar.gz scala-3a1332c451c8bd9b987ab3dbe775ef5a08360705.tar.bz2 scala-3a1332c451c8bd9b987ab3dbe775ef5a08360705.zip |
BigDecimal adjustments.
More sensible use of MathContext, plus some BigDecimal tests.
Contributed by Erik Osheim. Closes SI-4981, no review.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/math/BigDecimal.scala | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala index 4137f43ae9..553fb08c18 100644 --- a/src/library/scala/math/BigDecimal.scala +++ b/src/library/scala/math/BigDecimal.scala @@ -225,11 +225,11 @@ extends ScalaNumber with ScalaNumericConversions with Serializable { /** Addition of BigDecimals */ - def + (that: BigDecimal): BigDecimal = this.bigDecimal.add(that.bigDecimal, mc) + def + (that: BigDecimal): BigDecimal = this.bigDecimal.add(that.bigDecimal) /** Subtraction of BigDecimals */ - def - (that: BigDecimal): BigDecimal = this.bigDecimal.subtract(that.bigDecimal, mc) + def - (that: BigDecimal): BigDecimal = this.bigDecimal.subtract(that.bigDecimal) /** Multiplication of BigDecimals */ @@ -243,14 +243,14 @@ extends ScalaNumber with ScalaNumericConversions with Serializable { * divideToIntegralValue and the remainder. */ def /% (that: BigDecimal): (BigDecimal, BigDecimal) = - this.bigDecimal.divideAndRemainder(that.bigDecimal, mc) match { + this.bigDecimal.divideAndRemainder(that.bigDecimal) match { case Array(q, r) => (q, r) } /** Divide to Integral value. */ def quot (that: BigDecimal): BigDecimal = - this.bigDecimal.divideToIntegralValue(that.bigDecimal, mc) + this.bigDecimal.divideToIntegralValue(that.bigDecimal) /** Returns the minimum of this and that */ @@ -262,7 +262,7 @@ extends ScalaNumber with ScalaNumericConversions with Serializable { /** Remainder after dividing this by that. */ - def remainder (that: BigDecimal): BigDecimal = this.bigDecimal.remainder(that.bigDecimal, mc) + def remainder (that: BigDecimal): BigDecimal = this.bigDecimal.remainder(that.bigDecimal) /** Remainder after dividing this by that. */ @@ -274,11 +274,11 @@ extends ScalaNumber with ScalaNumericConversions with Serializable { /** Returns a BigDecimal whose value is the negation of this BigDecimal */ - def unary_- : BigDecimal = this.bigDecimal.negate(mc) + def unary_- : BigDecimal = this.bigDecimal.negate() /** Returns the absolute value of this BigDecimal */ - def abs: BigDecimal = this.bigDecimal abs mc + def abs: BigDecimal = this.bigDecimal abs /** Returns the sign of this BigDecimal, i.e. * -1 if it is less than 0, |