public Method

Float.>(p1)

flt > other      true or false

true if flt is greater than other.

Source Code

/*
* call-seq:
*   flt > other    =>  true or false
*
* <code>true</code> if <code>flt</code> is greater than <code>other</code>.
*/

static VALUE
flo_gt(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;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.