mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix a bug for the case frexp() return Infinity.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user