summaryrefslogtreecommitdiff
path: root/rational.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-05 00:37:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-05 00:37:40 +0000
commit6918746e4651c5511e99a2672db00431fdbd3340 (patch)
tree58f7600519ff256004fb5cf36649aa5525492428 /rational.c
parent4484390f9bcb821e2eb66e3ccda7f08a33555dd0 (diff)
Remove wrong conversion
* rational.c (nurat_to_double): should return `double`, not `Float`. fix r64897. [Bug #15189] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rational.c')
-rw-r--r--rational.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/rational.c b/rational.c
index 6426f23..d62a24f 100644
--- a/rational.c
+++ b/rational.c
@@ -1556,8 +1556,7 @@ nurat_to_double(VALUE self)
{
get_dat1(self);
if (!RB_INTEGER_TYPE_P(dat->num) || !RB_INTEGER_TYPE_P(dat->den)) {
- double d = NUM2DBL(dat->num) / NUM2DBL(dat->den);
- return DBL2NUM(d);
+ return NUM2DBL(dat->num) / NUM2DBL(dat->den);
}
return rb_int_fdiv_double(dat->num, dat->den);
}