Partager via


BITNOT( ) Function

Returns the result of a bitwise NOT operation performed on a numeric value.

BITNOT(nExpression)

Return Values

Numeric

Parameters

  • nExpression
    Specifies the numeric value on which the bitwise NOT operation is performed. If nExpression is not an integer, it is converted to an integer before its bits are shifted.

Remarks

BITNOT( ) returns the bitwise complement of nExpression. The numeric value returned by BITNOT( ) represents nExpression with each bit of value 0 switched to 1 and each bit of value 1 switched to 0.

The following table shows the result of a bitwise NOT operation on nExpression:

nExpression bit Resulting bit
0 1
1 0

Example

x = 5  && 0101 binary
? BITNOT(x) && Returns -6

See Also

BITAND( ) | BITCLEAR( ) | BITLSHIFT( ) | BITOR( ) | BITRSHIFT( ) | BITSET( ) | BITTEST( ) | BITXOR( )