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

ruby-changes:22966

From: usa <ko1@a...>
Date: Wed, 14 Mar 2012 17:56:53 +0900 (JST)
Subject: [ruby-changes:22966] usa:r35015 (trunk): * numeric.c (flodivmod): must through the same pass if HAVE_FMOD or not.

usa	2012-03-14 17:56:42 +0900 (Wed, 14 Mar 2012)

  New Revision: 35015

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

  Log:
    * numeric.c (flodivmod): must through the same pass if HAVE_FMOD or not.
      this is a bugfix of r35013.

  Modified files:
    trunk/ChangeLog
    trunk/numeric.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 35014)
+++ ChangeLog	(revision 35015)
@@ -1,3 +1,8 @@
+Wed Mar 14 17:55:29 2012  NAKAMURA Usaku  <usa@r...>
+
+	* numeric.c (flodivmod): must through the same pass if HAVE_FMOD or not.
+	  this is a bugfix of r35013.
+
 Wed Mar 14 16:41:55 2012  NAKAMURA Usaku  <usa@r...>
 
 	* test/test_tmpdir.rb (TestTmpdir#test_world_writable): skip on Windows.
Index: numeric.c
===================================================================
--- numeric.c	(revision 35014)
+++ numeric.c	(revision 35015)
@@ -814,18 +814,18 @@
     double div, mod;
 
     if (y == 0.0) rb_num_zerodiv();
-#ifdef HAVE_FMOD
-    mod = fmod(x, y);
-#else
     if((x == 0.0) || (isinf(y) && !isinf(x)))
         mod = x;
     else {
+#ifdef HAVE_FMOD
+	mod = fmod(x, y);
+#else
 	double z;
 
 	modf(x/y, &z);
 	mod = x - z * y;
+#endif
     }
-#endif
     if (isinf(x) && !isinf(y) && !isnan(y))
 	div = x;
     else

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

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