1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 01:10:23 +00:00
QB64-PE/internal/help/Template%3ALogicalTruthPlugin_10000000%31100000010000100000.txt
2022-08-02 23:02:18 +02:00

23 lines
2.6 KiB
Plaintext

{{QBDLDATE:08-02-2022}}
{{QBDLTIME:22:58:34}}
{{FixedStart}}
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:
┌───────────┬────────────────────────────────────────────────────────┐
│ '''Operands''' │ '''Logical operations''' │
├─────┬─────┼───────┬─────────┬────────┬─────────┬─────────┬─────────┤
│ '''A''' │ '''B''' │ [[NOT]] '''B''' │ '''A''' [[AND]] '''B''' │ '''A''' [[OR]] '''B''' │ '''A''' [[XOR]] '''B''' │ '''A''' [[EQV]] '''B''' │ '''A''' [[IMP]] '''B''' │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│ '''1''' │ '''1''' │ 0 │ 1 │ 1 │ 0 │ 1 │ 1 │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│ '''1''' │ '''0''' │ 1 │ 0 │ 1 │ 1 │ 0 │ 0 │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│ '''0''' │ '''1''' │ 0 │ 0 │ 1 │ 1 │ 0 │ 1 │
├─────┼─────┼───────┼─────────┼────────┼─────────┼─────────┼─────────┤
│ '''0''' │ '''0''' │ 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.
{{FixedEnd}}