merges r28652 from trunk into ruby_1_9_2.

--
* numeric.c (fix_divide): must not use rb_rational_new1 for coercion
  because it returns an argument itself when canonical mode is set.
  [ruby-core:31279]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-07-15 13:18:15 +00:00
parent 24d84e6d87
commit 835dcc220e
2 changed files with 7 additions and 1 deletions

View file

@ -2422,7 +2422,7 @@ fix_divide(VALUE x, VALUE y, ID op)
case T_RATIONAL:
if (op == '/' && FIX2LONG(x) == 1)
return rb_rational_reciprocal(y);
return rb_funcall(rb_rational_new1(x), op, 1, y);
/* fall through */
default:
return rb_num_coerce_bin(x, y, op);
}