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

Unified Diff: src/fast-dtoa.cc

Issue 1968003: Revert r4591 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 8 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 | « src/fast-dtoa.h ('k') | src/fixed-dtoa.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/fast-dtoa.cc
===================================================================
--- src/fast-dtoa.cc (revision 4591)
+++ src/fast-dtoa.cc (working copy)
@@ -314,7 +314,7 @@
// w's fractional part is therefore 0x567890abcdef.
// Printing w's integral part is easy (simply print 0x1234 in decimal).
// In order to print its fraction we repeatedly multiply the fraction by 10 and
-// get each digit. Example the first digit after the point would be computed by
+// get each digit. Example the first digit after the comma would be computed by
// (0x567890abcdef * 10) >> 48. -> 3
// The whole thing becomes slightly more complicated because we want to stop
// once we have enough digits. That is, once the digits inside the buffer
@@ -490,11 +490,18 @@
bool FastDtoa(double v,
Vector<char> buffer,
+ int* sign,
int* length,
int* point) {
- ASSERT(v > 0);
+ ASSERT(v != 0);
ASSERT(!Double(v).IsSpecial());
+ if (v < 0) {
+ v = -v;
+ *sign = 1;
+ } else {
+ *sign = 0;
+ }
int decimal_exponent;
bool result = grisu3(v, buffer, length, &decimal_exponent);
*point = *length + decimal_exponent;
« no previous file with comments | « src/fast-dtoa.h ('k') | src/fixed-dtoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698