Bitwise functions
There are bitwise functions in the program but they can operate only on non-negative values.
We don't define the BitNot() function too.
- BitAnd(x ; y) or band(x ; y)
- Bitwise AND. For example:
bitand(6; 2) = bitand(&110 ; &10) = &10 = 2
bitand(6.5; 2.5) = bitand(&110.1 ; &10.1) = &10.1 = 2.5
- BitOr(x ; y) or bor(x ; y)
- Bitwise OR. For example:
bitor(6; 1) = bitor(&110 ; &1) = &111 = 7
bitor(6.5; 1.5) = bitor(&110.1 ; &1.1) = &111.1 = 7.5
- BitXor(x ; y) or bxor(x ; y)
- Bitwise XOR. For example:
bitxor(6; 3) = bitxor(&110 ; &11) = &101 = 5
bitxor(6.5; 3.5) = bitxor(&110.1 ; &11.1) = &101.0 = 5