与Bitwise OR操作相反

Kap*_*pil 5 language-agnostic bit-manipulation bitwise-operators

我计算

c = a 'OR' b // bitwise OR operation here
Run Code Online (Sandbox Code Playgroud)

现在仅给出值c以及b如何计算原始值a

Cam*_*ium 22

这是不可能的.

一个简单的例子来证明我的观点(假设a,b和c都是1位):

如果'b'为1,'c'将始终为1,则无法确定'a'的值.


joe*_*ice 5

你无法可靠地回去。例如,a = 0010 且 b = 0011。a OR b = 0011。如果 a 不同(例如 0001 或 0011),则结果相同。