not

Syntax

not(X) or !(X)

Arguments

X is a scalar/pair/vector/matrix.

Details

Return NOT of each element of X. Returned values are 0, 1, or NULL. NOT of 0 is 1; NOT of NULL is still NULL; NOT of all other values is 0.

Examples

!1.5;
// output
0

not 0;
// output
1

x=1 0 2;
not x;
// output
[0,1,0]
m=1 1 1 1 1 0 0 0 0 0$2:5;
m;
#0 #1 #2 #3 #4
1 1 1 0 0
1 1 0 0 0
not m;
#0 #1 #2 #3 #4
0 0 0 1 1
0 0 1 1 1
(1).not();
// output
0

(!NULL)==NULL;
// output
1

Related functions: and, or