Reference Guide > TDV Support for SQL Functions > Binary Functions > NOT Functions
 
NOT Functions
The NOT functions change each 1 to a 0 and each 0 to a 1 in the binary representation of the argument.
Sample Syntax
INT1NOT(arg)
Remarks
As long as the argument value is in range of the function, the returned value is the same for INT1NOT, INT2NOT, INT4NOT, and INT8NOT. For example, INT1NOT(-127) = INT2NOT(-127) = INT4NOT(-127) = INT8NOT(-127).
Both 0 and -0 inputs return -1, but -1 input returns only 0.
Examples
The table shows representative input and output values for the INT1NOT function.
Function Input
Result
INT1NOT(0)
-1
INT1NOT(1)
-2
INT1NOT(2)
-3
. . .
 
INT1NOT(126)
-127
INT1NOT(127)
-128
INT1NOT(-128)
127
INT1NOT(-127)
126
. . .
 
INT1NOT(-2)
1
INT1NOT(-1)
0
INT1NOT(-0)
-1