Difference between revisions of "BitNot"
m (4.7 -> 5.0) |
|||
Line 15: | Line 15: | ||
==History== | ==History== | ||
− | Introduced in [[Analytica | + | Introduced in [[Analytica 5.0]]. |
== See Also == | == See Also == |
Latest revision as of 01:27, 28 April 2016
BitNot(x)
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.
Examples
BitNot(55) → -56
The same example shown in binary notation makes the bit inversion obvious
BitNot(0b110111) → 0b1111111111111111111111111111111111111111111111111111111111001000
History
Introduced in Analytica 5.0.
See Also
Comments
Enable comment auto-refresher