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;
0
$ not 0;
1
$ x=1 0 2;
$ not x;
[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();
0
$ (!NULL)==NULL;
1