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

Issue 9540015: Implement correct bigint to double conversion. (Closed)

Created:
8 years, 9 months ago by floitsch
Modified:
8 years, 9 months ago
Reviewers:
siva, cshapiro
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Implement correct bigint to double conversion. Committed: https://code.google.com/p/dart/source/detail?r=5863

Patch Set 1 #

Total comments: 10

Patch Set 2 : Upload #

Patch Set 3 : Copy over interesting parts of Jawa implementation. #

Patch Set 4 : Cleanups #

Patch Set 5 : Add tests. #

Patch Set 6 : upload #

Patch Set 7 : rebase #

Total comments: 4

Patch Set 8 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+245 lines, -18 lines) Patch
M runtime/vm/bigint_operations.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M runtime/vm/bigint_operations.cc View 1 2 3 4 5 6 7 4 chunks +137 lines, -9 lines 0 comments Download
M runtime/vm/bigint_operations_test.cc View 1 2 3 4 3 chunks +107 lines, -9 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
floitsch
8 years, 9 months ago (2012-02-29 19:43:11 UTC) #1
siva
8 years, 9 months ago (2012-03-01 01:44:05 UTC) #2
cshapiro
http://codereview.chromium.org/9540015/diff/1/runtime/vm/bigint_operations.cc File runtime/vm/bigint_operations.cc (right): http://codereview.chromium.org/9540015/diff/1/runtime/vm/bigint_operations.cc#newcode401 runtime/vm/bigint_operations.cc:401: if (bigint.IsZero()) { This fast path should be expanded ...
8 years, 9 months ago (2012-03-07 21:49:17 UTC) #3
floitsch
PTAL. http://chromiumcodereview.appspot.com/9540015/diff/1/runtime/vm/bigint_operations.cc File runtime/vm/bigint_operations.cc (right): http://chromiumcodereview.appspot.com/9540015/diff/1/runtime/vm/bigint_operations.cc#newcode401 runtime/vm/bigint_operations.cc:401: if (bigint.IsZero()) { On 2012/03/07 21:49:18, cshapiro wrote: ...
8 years, 9 months ago (2012-03-20 04:06:48 UTC) #4
cshapiro
lgtm http://chromiumcodereview.appspot.com/9540015/diff/16001/runtime/vm/bigint_operations.cc File runtime/vm/bigint_operations.cc (right): http://chromiumcodereview.appspot.com/9540015/diff/16001/runtime/vm/bigint_operations.cc#newcode495 runtime/vm/bigint_operations.cc:495: double absolute_value = static_cast<uint64_t>(AbsToUint64(bigint)); Is the static_cast<uint64_t>(...) needed? ...
8 years, 9 months ago (2012-03-23 00:44:39 UTC) #5
floitsch
8 years, 9 months ago (2012-03-26 22:52:05 UTC) #6
I slightly refactored the code so that twice_significand_floor and
twice_significand_exponent are in sync.
I assume it's still ok to submit, but let you some hours to have another look,
before submitting.

http://chromiumcodereview.appspot.com/9540015/diff/16001/runtime/vm/bigint_op...
File runtime/vm/bigint_operations.cc (right):

http://chromiumcodereview.appspot.com/9540015/diff/16001/runtime/vm/bigint_op...
runtime/vm/bigint_operations.cc:495: double absolute_value =
static_cast<uint64_t>(AbsToUint64(bigint));
On 2012/03/23 00:44:39, cshapiro wrote:
> Is the static_cast<uint64_t>(...) needed?  AbsToUint64 returns a uint64_t.  Am
I
> missing something? 

typo. Should have been static_cast<double>.
done.

http://chromiumcodereview.appspot.com/9540015/diff/16001/runtime/vm/bigint_op...
runtime/vm/bigint_operations.cc:547: uint64_t twice_significand_floor = 0;
On 2012/03/23 00:44:39, cshapiro wrote:
> Can we fold this into line 552?  There seem to be no intervening uses of
> twice_significand_floor and the assignment to firstDigit.

done.

Powered by Google App Engine
This is Rietveld 408576698