Commit 74e531ec authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

avoid isfinite() in num_pow

parent 470da1ed
...@@ -108,7 +108,7 @@ num_pow(mrb_state *mrb, mrb_value x) ...@@ -108,7 +108,7 @@ num_pow(mrb_state *mrb, mrb_value x)
mrb_get_args(mrb, "o", &y); mrb_get_args(mrb, "o", &y);
if (FIXNUM_P(x) && FIXNUM_P(y)) both_int = TRUE; if (FIXNUM_P(x) && FIXNUM_P(y)) both_int = TRUE;
d = pow(mrb_to_flo(mrb, x), mrb_to_flo(mrb, y)); d = pow(mrb_to_flo(mrb, x), mrb_to_flo(mrb, y));
if (both_int && isfinite(d) && FIXABLE(d)) if (both_int && FIXABLE(d))
return mrb_fixnum_value((mrb_int)d); return mrb_fixnum_value((mrb_int)d);
return mrb_float_value(d); return mrb_float_value(d);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment