summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 02:38:51 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-27 02:38:51 (GMT)
commit241ba38d7007ca64a2e18b8422b18a9988eeab3e (patch)
tree418f4554975429beaa0bafadc986e88b7facc091 /numeric.c
parent9eed577cf5e85fe0f62eb1c2b964e847e62c2612 (diff)
complex.c: no overflow
* complex.c (rb_complex_finite_p): get rid of overflow and unnecessary multiplication. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60040 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 f79e78f..5eff104 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1763,8 +1763,8 @@ flo_is_infinite_p(VALUE num)
* i.e. it is not infinite and Float#nan? is +false+.
*/
-static VALUE
-flo_is_finite_p(VALUE num)
+VALUE
+rb_flo_is_finite_p(VALUE num)
{
double value = RFLOAT_VALUE(num);
@@ -5592,7 +5592,7 @@ Init_Numeric(void)
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, "finite?", flo_is_finite_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);
rb_define_method(rb_cFloat, "positive?", flo_positive_p, 0);