summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-20 08:56:42 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-02-20 08:56:42 +0000
commit265442fbdbd384fdf68782613c200b86cdf2f0af (patch)
tree48f0b3d55c5ae930f5b63e58e581a49dcc37d2ed /numeric.c
parent861095398453d08ed3b104c1f3bad4d970552fab (diff)
1.1b8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@86 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/numeric.c b/numeric.c
index f924761001..e61f15d7c3 100644
--- a/numeric.c
+++ b/numeric.c
@@ -37,7 +37,9 @@ static VALUE
num_coerce(x, y)
VALUE x, y;
{
- return assoc_new(rb_Float(x),rb_Float(y));
+ if (CLASS_OF(x) == CLASS_OF(y))
+ return assoc_new(x, y);
+ return assoc_new(rb_Float(x), rb_Float(y));
}
coerce_body(x)