问题描述
什么是XAND和XOR?还有一个XNot
What are XAND and XOR? Also is there an XNot
推荐答案
XOR
是 exclusive或的缩写.这是一个逻辑二进制运算符,要求两个操作数之一为true,但不是两个都为真.
XOR
is short for exclusive or. It is a logical, binary operator that requires that one of the two operands be true but not both.
这些陈述是正确的:
TRUE XOR FALSE
FALSE XOR TRUE
这些陈述是错误的:
FALSE XOR FALSE
TRUE XOR TRUE
实际上并没有所谓的排他性和"(或XAND
),因为从理论上讲,它与XOR
具有完全相同的要求.还没有XNOT
,因为NOT
是一元运算符,它会否定其单个操作数(基本上只是将布尔值翻转为相反的值),因此它不支持任何排他性概念.
There really isn't such a thing as an"exclusive and" (or XAND
) since in theory it would have the same exact requirements as XOR
. There also isn't an XNOT
since NOT
is a unary operator that negates its single operand (basically it just flips a boolean value to its opposite) and as such it cannot support any notion of exclusivity.
这篇关于什么是XAND和XOR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!