public Method

Fixnum.<<(p1)

fix << count      integer

Shifts fix left count positions (right if count is negative).

Source Code

/*
* call-seq:
*   fix << count     => integer
*
* Shifts _fix_ left _count_ positions (right if _count_ is negative).
*/

static VALUE
rb_fix_lshift(x, y)
   VALUE x, y;
{
   long val, width;

   val = NUM2LONG(x);
   if (!FIXNUM_P(y))
       return rb_big_lshift(rb_int2big(val), y);
   width = FIX2LONG(y);
   if (width < 0)
       return fix_rshift(val, (unsigned long)-width);
   return fix_lshift(val, width);
}
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.