Fix a bug for the case frexp() return Infinity.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-01-25 15:43:46 +09:00
parent 23e5c08e31
commit efef4541aa
+1
View File
@@ -183,6 +183,7 @@ static void
float_decode_internal(mrb_state *mrb, mrb_float f, mrb_float *rf, int *n)
{
f = (mrb_float)frexp_rat(f, n);
if (isinf(f)) rat_overflow(mrb);
f = (mrb_float)ldexp_rat(f, RAT_MANT_DIG);
*n -= RAT_MANT_DIG;
*rf = f;