Template:LogicalTruthPlugin: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
{{FixedStart}}
{{FixedStart}}
   The results of the bitwise logical operations, where '''A''' and '''B''' are operands,
   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:
        and '''true''' or '''false''' indicate whether a bit is set or not set:
   ┌───────────────┬────────────────────────────────────────────────────────┐
   ┌───────────────┬────────────────────────────────────────────────────────┐
   │  '''Operands'''    │                  '''Logical operations'''                  │
   │  '''Operands'''    │                  '''Logical operations'''                  │

Revision as of 12:35, 3 August 2022

  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 BA AND BA OR BA XOR BA EQV BA IMP B │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ true  │ true  │ false │  true   │ true   │  false  │  true   │  true   │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ true  │ false │ true  │  false  │ true   │  true   │  false  │  false  │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ false │ true  │ false │  false  │ true   │  true   │  false  │  true   │
  ├───────┼───────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
  │ false │ false │ 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.