Should return +/- infinity for float division by zero.

parent 8175d92b
......@@ -901,6 +901,8 @@ fix_mod(mrb_state *mrb, mrb_value x)
/* ZeroDivisionError */
return mrb_fixnum_value(0);
#else
if (a > 0) return mrb_float_value(mrb, INFINITY);
if (a < 0) return mrb_float_value(mrb, INFINITY);
return mrb_float_value(mrb, NAN);
#endif
}
......
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