<=(p1)
public
true if flt is less than or equal to real.
Show source
static VALUE
flo_le(VALUE x, VALUE y)
{
double a, b;
a = RFLOAT_VALUE(x);
switch (TYPE(y)) {
case T_FIXNUM:
b = (double)FIX2LONG(y);
break;
case T_BIGNUM:
b = rb_big2dbl(y);
break;
case T_FLOAT:
b = RFLOAT_VALUE(y);
if (isnan(b)) return Qfalse;
break;
default:
return rb_num_coerce_relop(x, y, rb_intern("<="));
}
if (isnan(a)) return Qfalse;
return (a <= b)?Qtrue:Qfalse;
}