An expression performs a logical negation.
result = !expression
Parameters
Result
Any variable .
Expression
Any expression .
Description
The following table illustrates how result is determined.
If expression is |
then result is |
True |
False |
False |
True |
All unary operators, such as the ! operator, evaluate the value of an expression according to the following rules:
- If applied to an undefined or null expression, a run-time error is generated.
- object is converted to a string.
- If possible, the string is converted to a numeric value. Otherwise, a run-time error is generated.
- The Boolean value is treated as a numeric value (0 if False, or 1 if true).
The operator is used to produce a numeric value.
For the ! operator, if the expression is Non-zero, result is zero. If expression is zero, then result is 1.
Requirements
Version 1
Please see
~ operator | Operator Precedence | Operator Summary