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

Unified Diff: runtime/lib/double.dart

Issue 9338002: Fixed a bug in isNegate intrinsified code, fixed negation for doubles (handling of negative zeros... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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 | « no previous file | runtime/vm/disassembler_ia32.cc » ('j') | runtime/vm/disassembler_ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/double.dart
===================================================================
--- runtime/lib/double.dart (revision 3960)
+++ runtime/lib/double.dart (working copy)
@@ -48,6 +48,10 @@
double remainder_(double other) native "Double_remainder";
double operator negate() {
+ if (this == 0.0) {
+ // -0.0 is canonicalized by the VM's parser, therefore no cycles.
regis 2012/02/06 21:45:19 I do not understand this comment. Does it mean tha
srdjan 2012/02/06 22:07:24 Yes, it can, but it is important that -0.0 is not
+ return isNegative() ? 0.0 : -0.0;
+ }
return 0.0 - this;
}
bool operator ==(other) {
« no previous file with comments | « no previous file | runtime/vm/disassembler_ia32.cc » ('j') | runtime/vm/disassembler_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698