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

ruby-changes:15009

From: naruse <ko1@a...>
Date: Fri, 12 Mar 2010 09:45:29 +0900 (JST)
Subject: [ruby-changes:15009] Ruby:r26884 (trunk): * complex.c (f_signbit): remove condition for signbit because

naruse	2010-03-12 09:45:06 +0900 (Fri, 12 Mar 2010)

  New Revision: 26884

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

  Log:
    * complex.c (f_signbit): remove condition for signbit because
      all platforms have signbit from r26871.

  Modified files:
    trunk/ChangeLog
    trunk/complex.c

Index: complex.c
===================================================================
--- complex.c	(revision 26883)
+++ complex.c	(revision 26884)
@@ -1154,28 +1154,13 @@
     return Qfalse;
 }
 
-#ifndef HAVE_SIGNBIT
-#ifdef signbit
-#define HAVE_SIGNBIT 1
-#endif
-#endif
-
 inline static VALUE
 f_signbit(VALUE x)
 {
     switch (TYPE(x)) {
       case T_FLOAT: {
-#ifdef HAVE_SIGNBIT
 	double f = RFLOAT_VALUE(x);
 	return f_boolcast(!isnan(f) && signbit(f));
-#else
-	char s[2];
-	double f = RFLOAT_VALUE(x);
-
-	if (isnan(f)) return Qfalse;
-	(void)snprintf(s, sizeof s, "%.0f", f);
-	return f_boolcast(s[0] == '-');
-#endif
       }
     }
     return f_negative_p(x);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 26883)
+++ ChangeLog	(revision 26884)
@@ -1,3 +1,8 @@
+Fri Mar 12 09:43:11 2010  NARUSE, Yui  <naruse@r...>
+
+	* complex.c (f_signbit): remove condition for signbit because
+	  all platforms have signbit from r26871.
+
 Fri Mar 12 07:25:16 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* win32/win32.c (init_env): get rid of alloca() for outer string.

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

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