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:
parent
73549c501f
commit
a9723e96f5
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue