Skip to content

Commit

Permalink
Increase the number of bits
Browse files Browse the repository at this point in the history
This makes the tests pass. Ideally, we'd stay at or below 80 in this case, but that may not be possible. :-(
  • Loading branch information
ulfjack committed Dec 18, 2018
1 parent f5eed07 commit 471e583
Show file tree
Hide file tree
Showing 2 changed files with 4,456 additions and 4,456 deletions.
10 changes: 5 additions & 5 deletions ryu/d2fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ int d2fixed_buffered_n(double d, uint32_t precision, char* result) {
index += fill;
break;
}
uint32_t digits = mulShift2(m2, POW10_SPLIT_2[p], j);
uint32_t digits = mulShift(m2, POW10_SPLIT_2[p], j);
#ifdef RYU_DEBUG
printf("digits=%u\n", digits);
printf("idx=%d\n", idx);
Expand Down Expand Up @@ -709,16 +709,16 @@ int d2exp_buffered_n(double d, uint32_t precision, char* result) {
if (e2 < 0 && availableDigits == 0) {
int32_t idx = -e2 / 16;
#ifdef RYU_DEBUG
printf("e2=%d\n", e2);
printf("idx=%d\n", idx);
printf("idx=%d, e2=%d, min=%d\n", idx, e2, MIN_BLOCK_2[idx]);
#endif
for (int32_t i = MIN_BLOCK_2[idx]; i < 200; i++) {
int32_t j = ADDITIONAL_BITS_2 + (-e2 - 16 * idx);
uint32_t p = POW10_OFFSET_2[idx] + i;
digits = (p >= POW10_OFFSET_2[idx + 1]) ? 0 : mulShift2(m2, POW10_SPLIT_2[p], j);
digits = (p >= POW10_OFFSET_2[idx + 1]) ? 0 : mulShift(m2, POW10_SPLIT_2[p], j);
#ifdef RYU_DEBUG
printf("digits=%d\n", e2);
printf("exact=%" PRIu64 " * (%" PRIu64 " + %" PRIu64 " << 64) >> %d\n", m2, POW10_SPLIT_2[p][0], POW10_SPLIT_2[p][1], j);
printf("idx=%d\n", idx);
printf("digits=%d\n", digits);
#endif
if (printedDigits != 0) {
if (printedDigits + 9 > precision) {
Expand Down
Loading

0 comments on commit 471e583

Please sign in to comment.