public Method

Fixnum.to_f

fix.to_f  float

Converts fix to a Float.

Source Code

/*
*  call-seq:
*     fix.to_f -> float
*  
*  Converts <i>fix</i> to a <code>Float</code>.
*     
*/

static VALUE
fix_to_f(num)
   VALUE num;
{
   double val;

   val = (double)FIX2LONG(num);

   return rb_float_new(val);
}
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.