Index: runtime/lib/integers.dart |
diff --git a/runtime/lib/integers.dart b/runtime/lib/integers.dart |
index c1a79c8f843e7f9a4c9e596090f43dd603d19196..f2eaf9f645c762cfb51bac88c99937c5e2cf486e 100644 |
--- a/runtime/lib/integers.dart |
+++ b/runtime/lib/integers.dart |
@@ -97,15 +97,16 @@ class IntegerImplementation { |
int compareTo(Comparable other) { |
Lasse Reichstein Nielsen
2012/07/06 08:56:17
Argh. Why did we not define Comparable to be gener
floitsch
2012/07/06 13:18:55
Changing to num now, and adding generic type to co
|
final int EQUAL = 0, LESS = -1, GREATER = 1; |
+ if (other is double) { |
+ // Let the double implementation deal with -0.0 and NaN. |
+ return -other.compareTo(this.toDouble()); |
Lasse Reichstein Nielsen
2012/07/06 08:56:17
I think that's wrong.
If this is, e.g., 1<<2000 (a
floitsch
2012/07/06 13:18:55
Done.
|
+ } |
if (this < other) { |
return LESS; |
} else if (this > other) { |
return GREATER; |
- } else if (this == other) { |
- return EQUAL; |
} else { |
- // Other is NaN. |
- return LESS; |
+ return EQUAL; |
} |
} |