Binary operators

The binary operators, introduced in KCML 6.90, allow the manipulation of the bits of a number, using the basic operations of and, or and xor. The syntax used is that commonly found in languages such as C or Java, except that ^ is used by KCML for power. The complement operator reverses all the bits. Currently only 40-bits are supported and numbers outside this range will error.

Operator Syntax Assignment syntax Example
AND & &= 0x0011 & 0x0110 is 0x0010
OR | |= 0x0011 | 0x0110 is 0x0111
XOR BIN_XOR ^= 0x0011 ^ 0x0110 is 0x0101
Complement ~ ~0x0011 is 0xFFFFFFFFEE