public Method

Fixnum.~

~fix      integer

One’s complement: returns a number where each bit is flipped.

Source Code

/*
* call-seq:
*   ~fix     => integer
*
* One's complement: returns a number where each bit is flipped.
*/

static VALUE
fix_rev(num)
   VALUE num;
{
   long val = FIX2LONG(num);

   val = ~val;
   return LONG2NUM(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.