Logical operators act on the individual bits of ordinal expressions. Logical operators require operands that are of an integer type, and produce an integer type result. The possible logical operators are listed in table (8.4).
|
The following are valid logical expressions:
A shr 1 { same as A div 2, but faster}
Not 1 { equals -2 } Not 0 { equals -1 } Not -1 { equals 0 } B shl 2 { same as B * 4 for integers } 1 or 2 { equals 3 } 3 xor 1 { equals 2 } |