August 2000
Intermediate to advanced
800 pages
13h 15m
English
Relational operators compare values and return either TRUE or FALSE. Logical operators perform logical operations on TRUE and FALSE. Values used with a logical operator are converted into booleans prior to being evaluated. For numerical values, zero will be interpreted as FALSE, and other values will be TRUE. Empty strings are considered be FALSE, and any nonempty string is TRUE. Table 2.5 lists the logical and relational operators.
| Operator | Operation Performed |
|---|---|
| < | Is Less Than |
| > | Is Greater Than |
| <= | Is Less Than or Equal To |
| >= | Is Greater Than or Equal To |
| == | Is Equal To |
| != | Is Not Equal To |
| AND && | And |
| OR || | Or |
| XOR | Exclusive Or |
| ! | Not |
Notice that the equality operator is very similar to the assignment ...
Read now
Unlock full access