Topic: DMD0538

Help File Version: 2.9.4.37

Math Logical Not Operator


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.

 

 


See Also:

Add

Subtract

Multiply

Divide


Modulus / Remainder

Raise to a Power


Less Than

Less than or Equal To

 

Equal To

Not Equal To

 

Greater Than

Greater Than or Equal To


Logical AND

Logical OR


Bit-wise AND

Bit-wise OR

Bit-wise XOR


Shift Left

Shift Right

Unsigned Shift Right

 

Negate

Bit-wise Invert

Logical NOT

 


Related Topics:

MATH - Calculate Expression