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.
Though not and the ! operator often serve analogous
purposes, precedence behavior differs:
-
The
notfunction, when parenthesized carries the highest priority. Without parentheses,nothas lower precedence than the following expression, e.g.,not false and falseis equivalent tonot(false and false), which returns true. -
The
!operator always follows the precedence rule. For example:!false and falseis equivalent to(!false) and false, which returns false.
