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

Unified Diff: test/mjsunit/es6/math-log2-log10.js

Issue 739913003: Implement log10 via fdlibm port. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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
« src/third_party/fdlibm/fdlibm.cc ('K') | « src/third_party/fdlibm/fdlibm.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/es6/math-log2-log10.js
diff --git a/test/mjsunit/es6/math-log2-log10.js b/test/mjsunit/es6/math-log2-log10.js
index 4479894d7d89a0ebcd0ce4ecc6e8e5040e4f6421..4e69bb1641e2c01f3b37ac6123cc4332e0606b88 100644
--- a/test/mjsunit/es6/math-log2-log10.js
+++ b/test/mjsunit/es6/math-log2-log10.js
@@ -40,6 +40,12 @@
});
for (var i = -300; i < 300; i += 0.7) {
- assertEqualsDelta(i, Math.log10(Math.pow(10, i)), 1E-13);
+ assertEqualsDelta(i, Math.log10(Math.pow(10, i)), 1E-16);
Raymond Toy 2014/11/19 19:02:30 Nit: It would be useful to have a more accurate bo
Yang 2014/11/20 09:05:10 Done.
assertEqualsDelta(i, Math.log2(Math.pow(2, i)), 1E-13);
}
+
+for (var i = -311; i <= 308; i++) {
+ assertEquals(i, Math.log10(Math.pow(10, i)));
+}
+
+assertEquals(-307.77759430519706, Math.log10(1.5 * Math.pow(2, -1023)));
Raymond Toy 2014/11/19 19:02:30 Add comment that you're testing a denormal case.
Yang 2014/11/20 09:05:10 Done.
« src/third_party/fdlibm/fdlibm.cc ('K') | « src/third_party/fdlibm/fdlibm.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698