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

Unified Diff: test/mjsunit/math-sqrt.js

Issue 6688062: Add more tests to mul-exhaustive for constant left/right parameters. (Closed)
Patch Set: Removed loop from mul-extensive Created 9 years, 9 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 | test/mjsunit/mjsunit.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/math-sqrt.js
diff --git a/test/mjsunit/math-sqrt.js b/test/mjsunit/math-sqrt.js
index fb00d5ba8ab138ac6b8020387ede85c9a245fd92..45ec234db1cdcba769b3bd4ebead08ee739cebd0 100644
--- a/test/mjsunit/math-sqrt.js
+++ b/test/mjsunit/math-sqrt.js
@@ -29,7 +29,11 @@
function test(expected_sqrt, value) {
assertEquals(expected_sqrt, Math.sqrt(value));
- if (isFinite(value)) {
+ if (isFinite(value)) {
+ if ((1 / value) != -Infinity) {
+ // Math.pow(-0, 0.5) must be zero, but Math.sqrt(-0) is -0.
+ expected_sqrt = 0;
+ }
assertEquals(expected_sqrt, Math.pow(value, 0.5));
}
}
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698