ruby-changes:52707
From: nobu <ko1@a...>
Date: Fri, 5 Oct 2018 09:37:46 +0900 (JST)
Subject: [ruby-changes:52707] nobu:r64919 (trunk): Remove wrong conversion
nobu 2018-10-05 09:37:40 +0900 (Fri, 05 Oct 2018) New Revision: 64919 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64919 Log: Remove wrong conversion * rational.c (nurat_to_double): should return `double`, not `Float`. fix r64897. [Bug #15189] Modified files: trunk/rational.c Index: rational.c =================================================================== --- rational.c (revision 64918) +++ rational.c (revision 64919) @@ -1556,8 +1556,7 @@ nurat_to_double(VALUE self) https://github.com/ruby/ruby/blob/trunk/rational.c#L1556 { 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); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/