Skip to content

Commit

Permalink
Fix a 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 authored May 24, 2024
1 parent 51bfef1 commit 9bac14f
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 9bac14f

Please sign in to comment.