/* * call-seq: * flt <= other => true or false * * <code>true</code> if <code>flt</code> is less than * or equal to <code>other</code>. */ static VALUE flo_le(x, y) VALUE x, y; { double a, b; a = RFLOAT(x)->value; switch (TYPE(y)) { case T_FIXNUM: b = (double)FIX2LONG(y); break; case T_BIGNUM: b = rb_big2dbl(y); break; case T_FLOAT: b = RFLOAT(y)->value; if (isnan(b)) return Qfalse; break; default: return rb_num_coerce_relop(x, y); } if (isnan(a)) return Qfalse; return (a <= b)?Qtrue:Qfalse; }