public Method

Fixnum.size

fix.size  fixnum

Returns the number of bytes in the machine representation of a Fixnum.

1.size            #=> 4
-1.size           #=> 4
2147483647.size   #=> 4

Source Code

/*
*  call-seq:
*     fix.size -> fixnum
*  
*  Returns the number of <em>bytes</em> in the machine representation
*  of a <code>Fixnum</code>.
*     
*     1.size            #=> 4
*     -1.size           #=> 4
*     2147483647.size   #=> 4
*/

static VALUE
fix_size(fix)
   VALUE fix;
{
   return INT2FIX(sizeof(long));
}
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.