v2_4_6 - Show latest stable - 0 notes - Class: Integer
~() public

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

Inverts the bits in an integer. As Integers are conceptually infinite length, the result acts as if it had an infinite number of one bits to the left. In hex representations, this is displayed as two periods to the left of the digits.

sprintf("%X", ~0x1122334455)    #=> "..FEEDDCCBBAA"
Show source
Register or log in to add new notes.