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

Issue 1374005: Percise rounding parsing octal and hexadecimal strings.... (Closed)

Created:
10 years, 9 months ago by SeRya
Modified:
9 years, 7 months ago
Reviewers:
Oleg Eterevsky, Erik Corry, floitschv8
CC:
v8-dev
Visibility:
Public.

Description

Percise rounding parsing octal and hexadecimal strings. Rounding happens when the number exceeds 53 bits of floating point mantissa. Current implemetation ignores digits after some limits. 0x1000000000000081 was rounded to 0x1000000000000100 while 0x100000000000008000001 was rounded to 0x100000000000000000000. Committed: http://code.google.com/p/v8/source/detail?r=4309

Patch Set 1 : '' #

Total comments: 19

Patch Set 2 : '' #

Total comments: 4

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+125 lines, -73 lines) Patch
M src/conversions.cc View 1 2 3 chunks +101 lines, -72 lines 0 comments Download
M test/mjsunit/number-tostring.js View 1 1 chunk +2 lines, -0 lines 0 comments Download
M test/mjsunit/str-to-num.js View 1 2 chunks +22 lines, -1 line 0 comments Download

Messages

Total messages: 7 (0 generated)
SeRya
10 years, 9 months ago (2010-03-26 13:35:14 UTC) #1
Florian Loitsch
LGTM with comments. Are the existing unit-tests covering all the cases? http://codereview.chromium.org/1374005/diff/6001/7003 File src/conversions.cc (right): ...
10 years, 9 months ago (2010-03-29 11:12:23 UTC) #2
Florian Loitsch
test-files LGTM. somehow skipped over the test-file changes. So disregard my last comment about the ...
10 years, 9 months ago (2010-03-29 11:20:57 UTC) #3
SeRya
http://codereview.chromium.org/1374005/diff/6001/7003 File src/conversions.cc (right): http://codereview.chromium.org/1374005/diff/6001/7003#newcode277 src/conversions.cc:277: static bool inline isDigit(int x, int radix) { On ...
10 years, 9 months ago (2010-03-29 14:59:22 UTC) #4
Florian Loitsch
LGTM. http://codereview.chromium.org/1374005/diff/23001/24003 File src/conversions.cc (right): http://codereview.chromium.org/1374005/diff/23001/24003#newcode334 src/conversions.cc:334: bool zerro_tail = true; zero_tail http://codereview.chromium.org/1374005/diff/23001/24003#newcode350 src/conversions.cc:350: if ...
10 years, 9 months ago (2010-03-29 15:14:30 UTC) #5
Florian Loitsch
LGTM.
10 years, 9 months ago (2010-03-29 15:14:32 UTC) #6
SeRya
10 years, 9 months ago (2010-03-29 15:36:17 UTC) #7
http://codereview.chromium.org/1374005/diff/23001/24003
File src/conversions.cc (right):

http://codereview.chromium.org/1374005/diff/23001/24003#newcode334
src/conversions.cc:334: bool zerro_tail = true;
On 2010/03/29 15:14:30, Florian Loitsch wrote:
> zero_tail

Done.

http://codereview.chromium.org/1374005/diff/23001/24003#newcode350
src/conversions.cc:350: if ((number & 1) != 0 || !zerro_tail) {
On 2010/03/29 15:14:30, Florian Loitsch wrote:
> Add comment why we look at the last binary digit of the number. (I.e make a
> reference to "round to even").

Done.

Powered by Google App Engine
This is Rietveld 408576698