Skip to content

Binary Operations

Hissab supports the following binary operations.

OperatorExample
~
Bitwise Not
~0b10101010
0b-10101011
&
Bitwise AND
0b10101010 & 0b11001101
0b10001000
|
Bitwise OR
0b10101010 | 0b11001101
0b11101111
xor
Bitwise XOR
0b10101010 xor 0b1100110
0b11001100
>>
Bitwise right shift
0b10101010 >> 3
0b10101
<<
Bitwise left shift
0b10101010 << 3
0b10101010000

Binary operations can be performed not just on binary numbers but with any number system.

1234 & 0x123fe
210
~73453
-73,454