From ea5e91b51fd7b2957fd4febc57be1d61f6ca318f Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 27 Sep 2017 01:01:26 +0000 Subject: * complex.c: fix Complex#infinite? return value. Because nucomp_abs never returns negative value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index 3965f3dd2d..10ab4a4563 100644 --- a/complex.c +++ b/complex.c @@ -1342,7 +1342,7 @@ rb_complex_finite_p(VALUE self) /* * call-seq: - * cmp.infinite? -> nil or 1 or -1 + * cmp.infinite? -> nil or 1 * * Returns values corresponding to the value of +cmp+'s magnitude: * @@ -1365,7 +1365,7 @@ rb_complex_infinite_p(VALUE self) if (RB_FLOAT_TYPE_P(magnitude)) { const double f = RFLOAT_VALUE(magnitude); if (isinf(f)) { - return INT2FIX(f < 0 ? -1 : 1); + return ONE; } return Qnil; } -- cgit v1.2.3