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

ruby-changes:44995

From: usa <ko1@a...>
Date: Tue, 13 Dec 2016 01:18:51 +0900 (JST)
Subject: [ruby-changes:44995] usa:r57068 (trunk): get rid of a test failure with VC10.

usa	2016-12-13 01:18:45 +0900 (Tue, 13 Dec 2016)

  New Revision: 57068

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57068

  Log:
    get rid of a test failure with VC10.
    
    * numeric.c (round_half_up, round_half_down): use `round` always because it's
      defined in this file even if doesn't exist.

  Modified files:
    trunk/numeric.c
Index: numeric.c
===================================================================
--- numeric.c	(revision 57067)
+++ numeric.c	(revision 57068)
@@ -97,21 +97,13 @@ round_half_up(double x, double s) https://github.com/ruby/ruby/blob/trunk/numeric.c#L97
 {
     double f, xs = x * s;
 
-#ifdef HAVE_ROUND
     f = round(xs);
     if (s == 1.0) return f;
-#endif
     if (x > 0) {
-#ifndef HAVE_ROUND
-	f = floor(xs);
-#endif
 	if ((double)((f + 0.5) / s) <= x) f += 1;
 	x = f;
     }
     else {
-#ifndef HAVE_ROUND
-	f = ceil(xs);
-#endif
 	if ((double)((f - 0.5) / s) >= x) f -= 1;
 	x = f;
     }
@@ -123,20 +115,12 @@ round_half_down(double x, double s) https://github.com/ruby/ruby/blob/trunk/numeric.c#L115
 {
     double f, xs = x * s;
 
-#ifdef HAVE_ROUND
     f = round(xs);
-#endif
     if (x > 0) {
-#ifndef HAVE_ROUND
-	f = ceil(xs);
-#endif
 	if ((double)((f - 0.5) / s) >= x) f -= 1;
 	x = f;
     }
     else {
-#ifndef HAVE_ROUND
-	f = floor(xs);
-#endif
 	if ((double)((f + 0.5) / s) <= x) f += 1;
 	x = f;
     }

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

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