diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 01:01:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-27 01:01:26 +0000 |
commit | ea5e91b51fd7b2957fd4febc57be1d61f6ca318f (patch) | |
tree | 62336ed85306deef4ce94a1f89c3476672bb4e5a /complex.c | |
parent | b9031d70887890b123559d203a82d04b83fa53e5 (diff) |
* 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
Diffstat (limited to 'complex.c')
-rw-r--r-- | complex.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; } |