Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
XORゲートをコーディングしようとしていますが、これを見つけました:
return in[0] != in[1];
ここで、in[0] はたとえば true で、in[1] は false です。という事は承知しています !否定を与えますが、なぜ=が使用されるのですか?
OR および AND 演算子を使用してXOR演算子を実行できます。例えば:
return (in[0] | in[1]) & !(in[0] & in[1]);