Returns the bitwise one's complement of the integer portion of a number. Each 1 bit in «x» is changed to 0, and each 0 bit changed to «1».

Each integer is treated as having 64 bits. The two's complement binary representation is used for negative numbers.

This will generally be equivalent to -(x + 1) when «x» is an integer, but if you are manipulating the bits of an integer, the use of this function makes your intent more obvious.


BitNot(55) → -56

The same example shown in binary notation makes the bit inversion obvious

BitNot(0b110111) → 0b1111111111111111111111111111111111111111111111111111111111001000


Introduced in Analytica 5.0.

See Also


You are not allowed to post comments.