Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: runtime/lib/double.dart

Issue 1160453003: Fix 23563: double unary- operator unstable for NANs (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: s Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/double.cc ('k') | runtime/platform/globals.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/double.dart
diff --git a/runtime/lib/double.dart b/runtime/lib/double.dart
index 95f026da931a9b59c3bfdd8f53a1c53869e8d8b4..280bf3b4a470ec0d8a898c2c4ce684c4a2eb2e01 100644
--- a/runtime/lib/double.dart
+++ b/runtime/lib/double.dart
@@ -47,12 +47,11 @@ class _Double extends _Num implements double {
}
double _remainder(double other) native "Double_remainder";
double operator -() {
- if (this == 0.0) {
- // -0.0 is canonicalized by the VM's parser, therefore no cycles.
- return isNegative ? 0.0 : -0.0;
- }
- return 0.0 - this;
+ // Handles properly 0.0, NAN, and other doubles.
+ return this._flipSignBit;
}
+ double get _flipSignBit native "Double_flipSignBit";
+
bool operator ==(other) {
if (!(other is num)) return false;
return _equal(other.toDouble());
« no previous file with comments | « runtime/lib/double.cc ('k') | runtime/platform/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698