* 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
This commit is contained in:
parent
b9031d7088
commit
ea5e91b51f
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user