<(p1)
public
Returns true if float is less than real.
The result of NaN < NaN is undefined, so an implementation-dependent
value is returned.
Show source
static VALUE
flo_lt(VALUE x, VALUE y)
{
double a, b;
a = RFLOAT_VALUE(x);
if (RB_TYPE_P(y, T_FIXNUM) || RB_TYPE_P(y, T_BIGNUM)) {
VALUE rel = rb_integer_float_cmp(y, x);
if (FIXNUM_P(rel))
return -FIX2INT(rel) < 0 ? Qtrue : Qfalse;
return Qfalse;
}
else if (RB_TYPE_P(y, T_FLOAT)) {
b = RFLOAT_VALUE(y);
if (isnan(b)) return Qfalse;
}
else {
return rb_num_coerce_relop(x, y, '<');
}
if (isnan(a)) return Qfalse;
return (a < b)?Qtrue:Qfalse;
}