not_bits

Definition: atom x2 = not_bits(atom x1)
Description: Perform the logical NOT operation on each bit in x1.
A bit in x2 will be 1 when the corresponding bit in x1 is 0, and will be 0 when the corresponding bit in x1 is 1.
Comments: This function may be applied to an atom or sq_not_bits() to all elements of a sequence. The rules for sequence operations apply.

The argument must be representable as a 32-bit number, either signed or unsigned.

If you intend to manipulate full 32-bit values, you should declare your variables as atom, rather than integer. The integer type is limited to 31-bits.

Results are treated as signed numbers. They will be negative when the highest-order bit is 1.
Example:
a = not_bits(#000000F7)
-- a is -248 (i.e. FFFFFF08 interpreted as a negative number)
See Also: and_bits, or_bits, xor_bits, int_to_bits