/*
* call-seq:
* fix == other
*
* Return <code>true</code> if <code>fix</code> equals <code>other</code>
* numerically.
*
* 1 == 2 #=> false
* 1 == 1.0 #=> true
*/
static VALUE
fix_equal(VALUE x, VALUE y)
{
if (x == y) return Qtrue;
if (FIXNUM_P(y)) return Qfalse;
switch (TYPE(y)) {
case T_BIGNUM:
return rb_big_eq(y, x);
case T_FLOAT:
return (double)FIX2LONG(x) == RFLOAT_VALUE(y) ? Qtrue : Qfalse;
default:
return num_equal(x, y);
}
}