Template:LogicalTruthPlugin

From QB64 Phoenix Edition Wiki
Revision as of 22:16, 1 August 2022 by RhoSigma (talk | contribs)
Jump to navigation Jump to search
The results of the bitwise logical operations, where A and B are operands,
and 1 or 0 indicate whether a bit is set or not set:
┌───────────┬────────────────────────────────────────────────────────┐
│ OperandsLogical operations                   │
├─────┬─────┼───────┬─────────┬────────┬─────────┬─────────┬─────────┤
│  ABNOT BA AND BA OR BA XOR BA EQV BA IMP B │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│  11  │   0   │    1    │   1    │    0    │    1    │    1    │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│  10  │   1   │    0    │   1    │    1    │    0    │    0    │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│  01  │   0   │    0    │   1    │    1    │    0    │    1    │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│  00  │   1   │    0    │   0    │    0    │    1    │    1    │
└─────┴─────┴───────┴─────────┴────────┴─────────┴─────────┴─────────┘
Relational Operations return negative one (-1, all bits set) and zero
(0, no bits set) for true and false, respectively. This allows relational tests to be inverted and combined using the bitwise logical operations.