diff options
author | gogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-24 21:59:36 +0000 |
---|---|---|
committer | gogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-24 21:59:36 +0000 |
commit | c9592384450b7ac21a69d454d92bb8b65cb40b17 (patch) | |
tree | c2a3580fb025e48a652b3061ff419c849a24a3d2 | |
parent | 6d86d0773cba83adc7e186967fece96ece4ed8ca (diff) | |
download | ruby-c9592384450b7ac21a69d454d92bb8b65cb40b17.tar.gz |
* complex.c (k_inexact_p, k_exact_zero_p): use k_exact_zero_p macro
to remove k_inexact_p macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | complex.c | 9 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Tue Mar 25 06:55:43 2015 Kazuki Tanaka <gogotanaka@ruby-lang.org> + + * 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@gmail.com> * doc/extention.rdoc: move from toplevel document and added extname. @@ -265,7 +265,6 @@ k_complex_p(VALUE x) } #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) { 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) { 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) { 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, VALUE self) 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); } |