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

Unified Diff: tests/language/arithmetic_test.dart

Issue 11573044: Inline Doubles truncate and round. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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
Index: tests/language/arithmetic_test.dart
===================================================================
--- tests/language/arithmetic_test.dart (revision 16928)
+++ tests/language/arithmetic_test.dart (working copy)
@@ -282,17 +282,14 @@
Expect.equals(2.0, (2.1).round());
Expect.equals(-2.0, (-2.1).round());
Expect.equals(1.0, (0.5).round());
- // TODO(floitsch): enable or adapt test, once we reached conclusion on
- // b/4539188.
- // Expect.equals(-0.0, (-0.5).round());
- // TODO(srdjan): enable the following tests once isNegative works.
- // Expect.equals(true, (-0.0).round().isNegative);
- // Expect.equals(true, (-0.3).round().isNegative);
- // Expect.equals(true, (-0.5).round().isNegative);
+ Expect.equals(0.0, (0.49999999999999994).round());
+ Expect.equals(-0.0, (-0.49999999999999994).round());
+ Expect.equals(-1.0, (-0.5).round());
+ Expect.equals(true, (-0.0).round().isNegative);
+ Expect.equals(true, (-0.3).round().isNegative);
+ Expect.equals(true, (-0.5).round().isNegative);
Expect.equals(2.0, (1.5).round());
- // TODO(floitsch): enable or adapt test, once we reached conclusion on
- // b/4539188.
- // Expect.equals(-1.0, (-1.5).round());
+ Expect.equals(-2.0, (-1.5).round());
Florian Schneider 2013/01/11 09:49:30 Please also add another corner case (2^53-1) and -
srdjan 2013/01/11 19:41:08 Thanks, using 9007199254740991.0.
Expect.equals(1.0, (0.99).round());
// -- toInt --.
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language_x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698