Logical NOT Operator

The ! operator is a unary (prefix) logical NOT operator. This should not be confused with the ~ operator which is a bitwise NOT operator. The ! operator expects an integer right hand operand. If the operand is a string, it will be automatically coerced to an integer before the NOT operator is applied. Furthermore, the operand must be a boolean value where zero has the meaning false and non-zero has the meaning true.

Logical operators can only return 0 for false and 1 for true even though they accept non-zero for true.

 

syntax:

	! <right_expr>

<right_expr> is refered to as the right operand and may be a simple value or complex expression.

e.g.
	! 0					yields 1
	! 1					yields 0

	!  -1					yields 0
	! -15					yields 0

	! 0x1234				yields 0
	! ! 0x1234				yields 1

	! (0x1204 == 0x0051)			yields 1