[前][次][番号順一覧][スレッド一覧]

ruby-changes:30863

From: tadf <ko1@a...>
Date: Sun, 15 Sep 2013 13:42:24 +0900 (JST)
Subject: [ruby-changes:30863] tadf:r42942 (trunk): * rational.c (nurat_div): reverted r28844, r28886 and r28887.

tadf	2013-09-15 13:42:19 +0900 (Sun, 15 Sep 2013)

  New Revision: 42942

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42942

  Log:
    * rational.c (nurat_div): reverted r28844, r28886 and r28887.

  Modified files:
    trunk/ChangeLog
    trunk/rational.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42941)
+++ ChangeLog	(revision 42942)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Sep 15 13:31:23 2013  Tadayoshi Funaba  <tadf@d...>
+
+	* rational.c (nurat_div): reverted r28844, r28886 and r28887.
+
 Sat Sep 14 06:08:10 2013  Eric Hodel  <drbrain@s...>
 
 	* dir.c (dir_s_glob):  [DOC] Improve wording and layout.
Index: rational.c
===================================================================
--- rational.c	(revision 42941)
+++ rational.c	(revision 42942)
@@ -952,19 +952,8 @@ nurat_div(VALUE self, VALUE other) https://github.com/ruby/ruby/blob/trunk/rational.c#L952
 			    other, ONE, '/');
 	}
     }
-    else if (RB_TYPE_P(other, T_FLOAT)) {
-	{
-	    double x = RFLOAT_VALUE(other), den;
-	    get_dat1(self);
-
-	    if (isnan(x)) return DBL2NUM(NAN);
-	    if (isinf(x)) return INT2FIX(0);
-	    if (x != 0.0 && modf(x, &den) == 0.0) {
-		return rb_rational_raw2(dat->num, f_mul(rb_dbl2big(den), dat->den));
-	    }
-	}
+    else if (RB_TYPE_P(other, T_FLOAT))
 	return rb_funcall(f_to_f(self), '/', 1, other);
-    }
     else if (RB_TYPE_P(other, T_RATIONAL)) {
 	if (f_zero_p(other))
 	    rb_raise_zerodiv();

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]