diff options
author | mihaylov <mihaylov@epfl.ch> | 2007-04-17 13:35:17 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2007-04-17 13:35:17 +0000 |
commit | 9a17c7fb0860963c9f04116ba3dc17a566736f1a (patch) | |
tree | adb9f81154714fcf35ec58b9212d64465c946e42 /src | |
parent | b66389b2f2cdad15314445303dbc5c68293d3591 (diff) | |
download | scala-9a17c7fb0860963c9f04116ba3dc17a566736f1a.tar.gz scala-9a17c7fb0860963c9f04116ba3dc17a566736f1a.tar.bz2 scala-9a17c7fb0860963c9f04116ba3dc17a566736f1a.zip |
Improved implementation of BigInt.equals
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/BigInt.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/BigInt.scala b/src/library/scala/BigInt.scala index 0878d0d7aa..9e98ec5a3e 100644 --- a/src/library/scala/BigInt.scala +++ b/src/library/scala/BigInt.scala @@ -123,8 +123,8 @@ class BigInt(val bigInteger: BigInteger) extends runtime.BoxedNumber { /** Compares this BigInt with the specified value for equality. */ override def equals (that: Any): boolean = that match { - case that: runtime.BoxedDouble => this.bigInteger.doubleValue == that - case that: runtime.BoxedFloat => this.bigInteger.floatValue == that + case that: runtime.BoxedDouble => this.bigInteger.doubleValue == that.doubleValue + case that: runtime.BoxedFloat => this.bigInteger.floatValue == that.floatValue case that: runtime.BoxedNumber => this equals BigInt(that.longValue) case _ => false } |