nan?()
public
Returns true if flt is an invalid IEEE floating point
number.
a = -1.0
a.nan?
a = 0.0/0.0
a.nan?
Show source
/*
* call-seq:
* flt.nan? -> true or false
*
* Returns <code>true</code> if <i>flt</i> is an invalid IEEE floating
* point number.
*
* a = -1.0 #=> -1.0
* a.nan? #=> false
* a = 0.0/0.0
* a.nan?
*/
static VALUE
flo_is_nan_p(num)
VALUE num;
{
double value = RFLOAT(num)->value;
return isnan(value) ? Qtrue : Qfalse;
}