Negation
You can use the negation operator either outside a parenthesized condition (as we did on the previous page), or combined with the relational operators.
Negation
Operator | Operation | Examples of true conditions |
---|---|---|
'= | Not equal. | if (2 '= 3) || '(2 = 3) {write "unequal"} |
'> | Less than or equal. (Literally “not greater than”). | if (2 '> 3) || '(2 > 3) {write "less than or equal"} |
'< | Greater than or equal. (Literally “not less than”). | if (3 '< 3) || '(3 < 3) {write "greater than or equal"} |