Skip to content

Commit

Permalink
Fix short circuit bug
Browse files Browse the repository at this point in the history
r needs to be divided by 10^kappa in any case.
  • Loading branch information
jk-jeon committed May 24, 2024
1 parent 37b8090 commit 35f2429
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/dragonbox/dragonbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -3495,8 +3495,8 @@ namespace jkj {
// interval.
if (!interval_type.include_right_endpoint()) {
// Is r divisible by 10^kappa?
if (z_result.is_integer &&
div::check_divisibility_and_divide_by_pow10<kappa>(r)) {
if (div::check_divisibility_and_divide_by_pow10<kappa>(r) &&
z_result.is_integer) {
// This should be in the interval.
decimal_significand += r - 1;
}
Expand Down

0 comments on commit 35f2429

Please sign in to comment.