diff options
author | Shane Delmore <shane@delmore.io> | 2016-02-01 09:50:18 -0800 |
---|---|---|
committer | Shane Delmore <shane@delmore.io> | 2016-02-01 09:51:27 -0800 |
commit | 36bf0c9d58bd1a7aa378ae4a5283b0d3271b725b (patch) | |
tree | 2886bbd4d9feb4beb8bb883c88dcc639059f4942 /src/library | |
parent | 6ecb997fa8eb305bf547ec8a6106ba2fd777a594 (diff) | |
download | scala-36bf0c9d58bd1a7aa378ae4a5283b0d3271b725b.tar.gz scala-36bf0c9d58bd1a7aa378ae4a5283b0d3271b725b.tar.bz2 scala-36bf0c9d58bd1a7aa378ae4a5283b0d3271b725b.zip |
Extend BigDecimal with Ordered for java interop
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/math/BigDecimal.scala | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/library/scala/math/BigDecimal.scala b/src/library/scala/math/BigDecimal.scala index 371fd59a93..e769dfb8cb 100644 --- a/src/library/scala/math/BigDecimal.scala +++ b/src/library/scala/math/BigDecimal.scala @@ -397,7 +397,7 @@ object BigDecimal { * @version 1.1 */ final class BigDecimal(val bigDecimal: BigDec, val mc: MathContext) -extends ScalaNumber with ScalaNumericConversions with Serializable { +extends ScalaNumber with ScalaNumericConversions with Serializable with Ordered[BigDecimal] { def this(bigDecimal: BigDec) = this(bigDecimal, BigDecimal.defaultMathContext) import BigDecimal.RoundingMode._ import BigDecimal.{decimal, binary, exact} @@ -537,22 +537,6 @@ extends ScalaNumber with ScalaNumericConversions with Serializable { */ def compare (that: BigDecimal): Int = this.bigDecimal compareTo that.bigDecimal - /** Less-than-or-equals comparison of BigDecimals - */ - def <= (that: BigDecimal): Boolean = compare(that) <= 0 - - /** Greater-than-or-equals comparison of BigDecimals - */ - def >= (that: BigDecimal): Boolean = compare(that) >= 0 - - /** Less-than of BigDecimals - */ - def < (that: BigDecimal): Boolean = compare(that) < 0 - - /** Greater-than comparison of BigDecimals - */ - def > (that: BigDecimal): Boolean = compare(that) > 0 - /** Addition of BigDecimals */ def + (that: BigDecimal): BigDecimal = new BigDecimal(this.bigDecimal add that.bigDecimal, mc) |