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:
parent
73549c501f
commit
a9723e96f5
@ -3702,7 +3702,7 @@ static double
|
|||||||
fix_fdiv_double(VALUE x, VALUE y)
|
fix_fdiv_double(VALUE x, VALUE y)
|
||||||
{
|
{
|
||||||
if (FIXNUM_P(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)) {
|
else if (RB_TYPE_P(y, T_BIGNUM)) {
|
||||||
return rb_big_fdiv_double(rb_int2big(FIX2LONG(x)), y);
|
return rb_big_fdiv_double(rb_int2big(FIX2LONG(x)), y);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user