LOGNOT

Syntax

LOGNOT integer

Explanation

LOGNOT outputs the bitwise logical complement of its input, replacing all 1's with 0's and all 0's with 1's. Since integers are stored in the computer as 16 base 2 digits long, all the leading 0's turn into 1's.

See also LOGAND, LOGOR, and LOGXOR.

Example

? MAKE "BASE 2

? 21

Result: 010101

? LOGNOT 21

Result: 0111111111101010

?