Skip to content

Commit d246504

Browse files
authored
Fix to_f underflow check when DECDIG is uint16_t (#364)
1 parent f5d17e2 commit d246504

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ext/bigdecimal/bigdecimal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1353,7 +1353,7 @@ BigDecimal_to_f(VALUE self)
13531353
return rb_float_new(d);
13541354
if (e > (SIGNED_VALUE)(DBL_MAX_10_EXP+BASE_FIG))
13551355
goto overflow;
1356-
if (e < (SIGNED_VALUE)(DBL_MIN_10_EXP-BASE_FIG))
1356+
if (e < (SIGNED_VALUE)(DBL_MIN_10_EXP-DBL_DIG))
13571357
goto underflow;
13581358

13591359
str = rb_str_new(0, VpNumOfChars(v.real, "E"));

0 commit comments

Comments
 (0)