xor with 3 values

后端 未结 10 1496
野性不改
野性不改 2020-12-30 22:12

I need to do an xor conditional between 3 values, ie i need one of the three values to be true but not more than one and not none.

I thought i could use the xor ^ op

10条回答
  •  既然无缘
    2020-12-30 22:16

    One way would be to convert the Boolean values to an integer, add the results, and compare to 1.

提交回复
热议问题