The bitwise NOT (~) performs a NOT operation on each bit in a value.

Syntax:

~expression

Returns:

Description

The truth table for the NOT operation is:

1337  (base 10) = 0000010100111001 (base 2)
~1337 (base 10) = 1111101011000110 (base 2) = -1338 (base 10)

A bitwise not on a number results in: -(x + 1).

Examples

Untitled Database