public Method

Integer.round

int.to_i       int
int.to_int     int
int.floor      int
int.ceil       int
int.round      int
int.truncate   int

As int is already an Integer, all these methods simply return the receiver.

Source Code

/*
*  call-seq:
*     int.to_i      => int
*     int.to_int    => int
*     int.floor     => int
*     int.ceil      => int
*     int.round     => int
*     int.truncate  => int
*
*  As <i>int</i> is already an <code>Integer</code>, all these
*  methods simply return the receiver.
*/

static VALUE
int_to_i(num)
   VALUE num;
{
   return num;
}
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.