1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

numeric.c: avoid division by zero

Forgot to add in r65751.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2018-11-16 04:05:53 +00:00
parent 73549c501f
commit a9723e96f5

View file

@ -3702,7 +3702,7 @@ static double
fix_fdiv_double(VALUE x, VALUE y)
{
if (FIXNUM_P(y)) {
return (double)FIX2LONG(x) / (double)FIX2LONG(y);
return double_div_double(FIX2LONG(x), FIX2LONG(y));
}
else if (RB_TYPE_P(y, T_BIGNUM)) {
return rb_big_fdiv_double(rb_int2big(FIX2LONG(x)), y);