Commit 856b8d96 authored by KOBAYASHI Shuji's avatar KOBAYASHI Shuji

Remove duplicate code in numeric.c

parent 8dcd66cc
...@@ -1150,7 +1150,7 @@ fix_to_f(mrb_state *mrb, mrb_value num) ...@@ -1150,7 +1150,7 @@ fix_to_f(mrb_state *mrb, mrb_value num)
* (in particular infinite or NaN) * (in particular infinite or NaN)
* to numerical classes which don't support them. * to numerical classes which don't support them.
* *
* Float::INFINITY.to_r * Float::INFINITY.to_i
* *
* <em>raises the exception:</em> * <em>raises the exception:</em>
* *
...@@ -1169,12 +1169,7 @@ mrb_flo_to_fixnum(mrb_state *mrb, mrb_value x) ...@@ -1169,12 +1169,7 @@ mrb_flo_to_fixnum(mrb_state *mrb, mrb_value x)
else { else {
mrb_float d = mrb_float(x); mrb_float d = mrb_float(x);
if (isinf(d)) { mrb_check_num_exact(mrb, d);
mrb_raise(mrb, E_FLOATDOMAIN_ERROR, d < 0 ? "-Infinity" : "Infinity");
}
if (isnan(d)) {
mrb_raise(mrb, E_FLOATDOMAIN_ERROR, "NaN");
}
if (FIXABLE_FLOAT(d)) { if (FIXABLE_FLOAT(d)) {
z = (mrb_int)d; z = (mrb_int)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