/* * call-seq: * flt <=> numeric => -1, 0, +1 * * Returns -1, 0, or +1 depending on whether <i>flt</i> is less than, * equal to, or greater than <i>numeric</i>. This is the basis for the * tests in <code>Comparable</code>. */ static VALUE flo_cmp(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; break; default: return rb_num_coerce_cmp(x, y); } return rb_dbl_cmp(a, b); }