Skip to main content

Not And (NAND) ('&)

Reverses the truth value of the & And applied to both operands.

Details

The Not And operator reverses the truth value of the & And applied to both operands. It produces a value of TRUE (1) when either or both operands are false. It produces a value of FALSE when both operands are TRUE.

The && And operator cannot be prefixed with a Not operator: the format '&& is not supported. However, the following format is supported:

'(operand && operand)

Examples

The following example performs two equivalent Not And operations. Each evaluates one FALSE (0) and one TRUE (1) operand and produces a value of TRUE (1).

 SET A=0,B=1
 WRITE !,A'&B   // Returns 1
 WRITE !,'(A&B) // Returns 1

The following example performs a Not And operation by performing a && And operation and then using a Not to invert the result. The && operation tests the first operand and, because the boolean value is FALSE (0), && does not test the second operand. The Not inverts the resulting boolean value, so that the expression returns TRUE (1):

 SET A=0
 WRITE !,'(A&&B)   // Returns 1
FeedbackOpens in a new tab