Skip to content

Commit

Permalink
Use correct exponent q
Browse files Browse the repository at this point in the history
This is not strictly necessary, because we can show correctness even with q-1, but it's more consistent.

Progress on #117.
  • Loading branch information
ulfjack committed Jun 5, 2019
1 parent 00ecce8 commit 159ce15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ryu/d2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static inline floating_decimal_64 d2d(const uint64_t ieeeMantissa, const uint32_
// <=> ntz(mv) >= q - 1 (e2 is negative and -e2 >= q)
// <=> (mv & ((1 << (q - 1)) - 1)) == 0
// We also need to make sure that the left shift does not overflow.
vrIsTrailingZeros = multipleOfPowerOf2(mv, q - 1);
vrIsTrailingZeros = multipleOfPowerOf2(mv, q);
#ifdef RYU_DEBUG
printf("vr is trailing zeros=%s\n", vrIsTrailingZeros ? "true" : "false");
#endif
Expand Down

0 comments on commit 159ce15

Please sign in to comment.