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

Unified Diff: src/conversions.cc

Issue 88583002: Increase precision for base conversion for large integers. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3025.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.cc
diff --git a/src/conversions.cc b/src/conversions.cc
index 5f1219eea9139cf2aa77c0c8dda95609b6a12481..397f3c57fb8628de2e39b521ff2298dcf977db41 100644
--- a/src/conversions.cc
+++ b/src/conversions.cc
@@ -401,8 +401,9 @@ char* DoubleToRadixCString(double value, int radix) {
// at least one digit.
int integer_pos = kBufferSize - 2;
do {
- integer_buffer[integer_pos--] =
- chars[static_cast<int>(fmod(integer_part, radix))];
+ double remainder = fmod(integer_part, radix);
+ integer_buffer[integer_pos--] = chars[static_cast<int>(remainder)];
+ integer_part -= remainder;
integer_part /= radix;
} while (integer_part >= 1.0);
// Sanity check.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-3025.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698