I know the AND word defines binary and
... but what defines logical and
?
The same word, AND
, is also used for logical and. But the two input values to AND
are recommended to be well-formed flags; true and false are represented by two values, bits all set (-1) and bits all unset (0). Other values than these may work as true (as in C), but it may lead to subtle errors.
All comparison operators return well-formed flags, but for instance -
does not. The following evaluates to false (0).
7 5 - 7 3 - AND
AND
gets bit patterns 100 and 010. The result is 0 (as it does the bitwise and).
References:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With