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

Unified Diff: test/mjsunit/number-tostring.js

Issue 2520363002: Reimplement Number.prototype.toString with non-default radix. (Closed)
Patch Set: readd copyright headers Created 4 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
Index: test/mjsunit/number-tostring.js
diff --git a/test/mjsunit/number-tostring.js b/test/mjsunit/number-tostring.js
index 55655f408247a152db33f32ace0c0a5747c6eb48..d428b697fe88639c3ad5a4a6baad4ffa55a14ecd 100644
--- a/test/mjsunit/number-tostring.js
+++ b/test/mjsunit/number-tostring.js
@@ -144,6 +144,13 @@ assertEquals("1e-7", (0.0000001).toString());
assertEquals("8.8", (8.5).toString(16));
assertEquals("-8.8", (-8.5).toString(16));
+assertEquals("1.1", (4/3).toString(3));
+assertEquals("11.1", (13/3).toString(3));
+assertEquals("0.01", (1/9).toString(3));
+assertEquals("10000", (81).toString(3));
+assertEquals("10000.01", (81 + 1/9).toString(3));
+assertEquals("0.0212010212010212010212010212010212", (2/7).toString(3));
+
// ----------------------------------------------------------------------
// toFixed
assertEquals("NaN", (NaN).toFixed(2));

Powered by Google App Engine
This is Rietveld 408576698