Difference between revisions of "Template:LogicalTruthTable"

From QB64 Wiki
Jump to navigation Jump to search
imported>Stylin
(new template for embedding in logical operator pages)
 
imported>Stylin
m (wording)
Line 15: Line 15:
|align="center"|F || align="center"|F || align="center"|T || align="center"|F || align="center"|F || align="center"|F || align="center"|T || align="center"|T
|align="center"|F || align="center"|F || align="center"|T || align="center"|F || align="center"|F || align="center"|F || align="center"|T || align="center"|T
|}
|}
:'''Note that the [[Relational Operations]] return negative one (<tt>-1</tt>, all bits set) and zero (<tt>0</tt>, no bits set) for ''true'' and ''false'', respectively. This allows relational tests to be inverted and combined with the bitwise logical operations.'''
:'''Note that the [[Relational Operations]] return negative one (<tt>-1</tt>, all bits set) and zero (<tt>0</tt>, no bits set) for ''true'' and ''false'', respectively. This allows relational tests to be inverted and combined using the bitwise logical operations.'''


<noinclude>
<noinclude>

Revision as of 01:15, 24 December 2009

The following table shows the results of the bitwise logical operations, where A and B are operands, and T and F indicate a bit in the operand that is set or not set, respectively:

Operands Operations
A B NOT B A AND B A OR B A XOR B A EQV B A IMP B
T T F T T F T T
T F T F T T F F
F T F F T T F T
F F T F F F T T
Note that the 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.