summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-03 02:39:42 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-03 02:39:42 +0000
commit65992061b918c397cfff6214bec556d7e83b835d (patch)
treec445905ea340318687021ed6126304fde7e69157 /numeric.c
parentce2bc45ae8679b40e97d6794e4e7a31b68444615 (diff)
merge revision(s) 60040,60188: [Backport #14014]
complex.c: no overflow * complex.c (rb_complex_finite_p): get rid of overflow and unnecessary multiplication. test_complex.rb: NaN Complex * test/ruby/test_complex.rb (test_finite_p): assertions for NaN Complex. NaN is not an infinite nor a finite number. [ruby-core:83272] [Bug #14014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@62173 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 631e199dcc..de30ab8497 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1782,8 +1782,8 @@ flo_is_infinite_p(VALUE num)
*
*/
-static VALUE
-flo_is_finite_p(VALUE num)
+VALUE
+rb_flo_is_finite_p(VALUE num)
{
double value = RFLOAT_VALUE(num);
@@ -5495,7 +5495,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);