infinite?()
public
Return values corresponding to the value of float:
finite |
nil
|
-Infinity |
-1
|
+Infinity |
1
|
For example:
(0.0).infinite?
(-1.0/0.0).infinite?
(+1.0/0.0).infinite?
Show source
static VALUE
flo_is_infinite_p(VALUE num)
{
double value = RFLOAT_VALUE(num);
if (isinf(value)) {
return INT2FIX( value < 0 ? -1 : 1 );
}
return Qnil;
}