Is there a name for logical AND with the negation (~
) of the second variable, i.e:
A & (~B)
The truth table for such operation is:
0 & (~0) = 0
0 & (~1) = 0
1 & (~0) = 1
1 & (~1) = 0
And in longer sequences of bits,
A = 10110011
B = 10111001
A & B = 10110001
A &(~B) = 00000010
PS - I'm interested with OR with the negation of the second variable, too.
Logical Operators/is the logical not operator. && is the logical and operator. It returns TRUE if both of the arguments evaluate to TRUE. This operator supports short-circuit evaluation, which means that if the first argument is FALSE the second is never evaluated.
There are five logical operator symbols: tilde, dot, wedge, horseshoe, and triple bar.
There are four logical operators in JavaScript: || (OR), && (AND), ! (NOT), ?? (Nullish Coalescing).
Example 5: Logical Operators(a == b) && (c > 5) evaluates to 1 because both operands (a == b) and (c > b) is 1 (true). (a == b) && (c < b) evaluates to 0 because operand (c < b) is 0 (false). (a == b) || (c < b) evaluates to 1 because (a = b) is 1 (true).
Incredible. A & (~B) is called Material nonimplication, and A | (~B) is called Material implication Seems that every possible binary operation has a name.
The set theoretic term is the "relative complement" of B with respect to A.
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