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

ruby-changes:37997

From: gogotanaka <ko1@a...>
Date: Wed, 25 Mar 2015 07:00:01 +0900 (JST)
Subject: [ruby-changes:37997] gogotanaka:r50078 (trunk): * complex.c (k_inexact_p, k_exact_zero_p): use k_exact_zero_p macro

gogotanaka	2015-03-25 06:59:36 +0900 (Wed, 25 Mar 2015)

  New Revision: 50078

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

  Log:
    * complex.c (k_inexact_p, k_exact_zero_p): use k_exact_zero_p macro
      to remove k_inexact_p macro.

  Modified files:
    trunk/ChangeLog
    trunk/complex.c
Index: complex.c
===================================================================
--- complex.c	(revision 50077)
+++ complex.c	(revision 50078)
@@ -265,7 +265,6 @@ k_complex_p(VALUE x) https://github.com/ruby/ruby/blob/trunk/complex.c#L265
 }
 
 #define k_exact_p(x) (!k_float_p(x))
-#define k_inexact_p(x) k_float_p(x)
 
 #define k_exact_zero_p(x) (k_exact_p(x) && f_zero_p(x))
 #define k_exact_one_p(x) (k_exact_p(x) && f_one_p(x))
@@ -1435,7 +1434,7 @@ nucomp_to_i(VALUE self) https://github.com/ruby/ruby/blob/trunk/complex.c#L1434
 {
     get_dat1(self);
 
-    if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+    if (!k_exact_zero_p(dat->imag)) {
 	rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Integer",
 		 self);
     }
@@ -1458,7 +1457,7 @@ nucomp_to_f(VALUE self) https://github.com/ruby/ruby/blob/trunk/complex.c#L1457
 {
     get_dat1(self);
 
-    if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+    if (!k_exact_zero_p(dat->imag)) {
 	rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Float",
 		 self);
     }
@@ -1483,7 +1482,7 @@ nucomp_to_r(VALUE self) https://github.com/ruby/ruby/blob/trunk/complex.c#L1482
 {
     get_dat1(self);
 
-    if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+    if (!k_exact_zero_p(dat->imag)) {
 	rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
 		 self);
     }
@@ -1510,7 +1509,7 @@ nucomp_rationalize(int argc, VALUE *argv https://github.com/ruby/ruby/blob/trunk/complex.c#L1509
 
     rb_scan_args(argc, argv, "01", NULL);
 
-    if (k_inexact_p(dat->imag) || f_nonzero_p(dat->imag)) {
+    if (!k_exact_zero_p(dat->imag)) {
        rb_raise(rb_eRangeError, "can't convert %"PRIsVALUE" into Rational",
                 self);
     }
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50077)
+++ ChangeLog	(revision 50078)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Mar 25 06:55:43 2015  Kazuki Tanaka  <gogotanaka@r...>
+
+	* complex.c (k_inexact_p, k_exact_zero_p): use k_exact_zero_p macro
+	  to remove k_inexact_p macro.
+
 Tue Mar 24 22:23:33 2015  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* doc/extention.rdoc: move from toplevel document and added extname.

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

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