The Math Logical Not operator ( ! ) inverts the zero / no-zero state of the operand. If the operand is 0 the
result is 1, if the operand is non-zero the result is 0.
The operand can be any mix of signed integers, unsigned integers, real
(floating point) numbers or discrete values. They can be any numeric or
discrete memory location, or any numeric or discrete structure member.
All discrete values and all 16-bit integer values are promoted to 32-bit
2's complement signed integer values. If a Real value is included in the
equation then all of the values will be promoted to Real values and all
calculations will be performed using Real numbers.
Traditional math precedence rules are used to solve the math expression,
The use of parentheses to remove any ambiguity in the processing order
is encouraged.
Assume D1 = 123456789 and D2 = 0 and X0 = ON
D0 = !D1
D0 = !123456789
D0 = 0
The operand is a signed integer memory location.
The result is placed in a signed integer memory location.
D0 = !D2
D0 = !0
D0 = 1
The operand is a signed integer memory location.
The result is placed in a signed integer memory location.
C0 = !X0
C0 = !ON
C0 = OFF
The operand is a discrete memory location.
The result is placed in a discrete memory location.