summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 02:55:03 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 02:55:03 (GMT)
commit65d7479920d1bc94a25dbd759bb573c7b88c9fe1 (patch)
tree8b373152fde59802bafa8653f5f6d9d33b944edf /numeric.c
parent241ba38d7007ca64a2e18b8422b18a9988eeab3e (diff)
complex.c: no overflow
* complex.c (rb_complex_infinite_p): get rid of overflow and unnecessary multiplication. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index 5eff104..1858113 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1743,8 +1743,8 @@ flo_is_nan_p(VALUE num)
* (+1.0/0.0).infinite? #=> 1
*/
-static VALUE
-flo_is_infinite_p(VALUE num)
+VALUE
+rb_flo_is_infinite_p(VALUE num)
{
double value = RFLOAT_VALUE(num);
@@ -5591,7 +5591,7 @@ Init_Numeric(void)
rb_define_method(rb_cFloat, "truncate", flo_truncate, -1);
rb_define_method(rb_cFloat, "nan?", flo_is_nan_p, 0);
- rb_define_method(rb_cFloat, "infinite?", flo_is_infinite_p, 0);
+ rb_define_method(rb_cFloat, "infinite?", rb_flo_is_infinite_p, 0);
rb_define_method(rb_cFloat, "finite?", rb_flo_is_finite_p, 0);
rb_define_method(rb_cFloat, "next_float", flo_next_float, 0);
rb_define_method(rb_cFloat, "prev_float", flo_prev_float, 0);