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. |