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

ruby-changes:21150

From: marcandre <ko1@a...>
Date: Tue, 6 Sep 2011 06:46:52 +0900 (JST)
Subject: [ruby-changes:21150] marcandRe: r33199 (trunk): * numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit platform

marcandre	2011-09-06 06:45:25 +0900 (Tue, 06 Sep 2011)

  New Revision: 33199

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

  Log:
    * numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit platform
      part 1 of [bug #5276]

  Modified files:
    trunk/ChangeLog
    trunk/numeric.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33198)
+++ ChangeLog	(revision 33199)
@@ -1,3 +1,8 @@
+Tue Sep  6 06:44:57 2011  Marc-Andre Lafortune  <ruby-core@m...>
+
+	* numeric.c (dbl2ival): Fix Float#divmod and #round for 32 bit
+	  platform. part 1 of [bug #5276]
+
 Tue Sep  6 06:44:25 2011  Marc-Andre Lafortune  <ruby-core@m...>
 
 	* numeric.c (flo_round): Fix criteria for 32 bits platform
Index: numeric.c
===================================================================
--- numeric.c	(revision 33198)
+++ numeric.c	(revision 33199)
@@ -873,8 +873,8 @@
 static VALUE
 dbl2ival(double d)
 {
+    d = round(d);
     if (FIXABLE(d)) {
-	d = round(d);
 	return LONG2FIX((long)d);
     }
     return rb_dbl2big(d);

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

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