Bitwise NOT operator inverts all bits of the expression.

Syntax:

~exp
      

The following code fragment illustrates the use of the bitwise NOT operator:

~7       // evaluates to -8
      

This operator is not applicable to floating-point values.