Template:LogicalTruthPlugin

From QB64 Phoenix Edition Wiki
Revision as of 16:42, 14 December 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 true or false indicate whether a bit is set or not set:
  ┌───────────────┬────────────────────────────────────────────────────────┐
  │   OperandsLogical operations                   │
  ├───────┬───────┼───────┬─────────┬────────┬─────────┬─────────┬─────────┤
  │   ABNOT B │ A AND B │ A OR B │ A XOR B │ A EQV B │ A IMP B │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ truetrue  │ false │  true   │ true   │  false  │  true   │  true   │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ truefalse │ true  │  false  │ true   │  true   │  false  │  false  │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ falsetrue  │ false │  false  │ true   │  true   │  false  │  true   │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ falsefalse │ true  │  false  │ false  │  false  │  true   │  true   │
  └───────┴───────┴───────┴─────────┴────────┴─────────┴─────────┴─────────┘
    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.