public Method

Fixnum.quo(p1)

fix.quo(numeric)     float

Returns the floating point result of dividing fix by numeric.

654321.quo(13731)      #=> 47.6528293642124
654321.quo(13731.24)   #=> 47.6519964693647

Source Code

/*
*  call-seq:
*     fix.quo(numeric)    => float
*  
*  Returns the floating point result of dividing <i>fix</i> by
*  <i>numeric</i>.
*     
*     654321.quo(13731)      #=> 47.6528293642124
*     654321.quo(13731.24)   #=> 47.6519964693647
*     
*/

static VALUE
fix_quo(x, y)
   VALUE x, y;
{
   if (FIXNUM_P(y)) {
       return rb_float_new((double)FIX2LONG(x) / (double)FIX2LONG(y));
   }
   return rb_num_coerce_bin(x, y);
}
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.