XOR using mathematical operators

前端 未结 9 1617
北海茫月
北海茫月 2021-02-05 09:57

How can I implement XOR using basic mathematical operators like +,-,*,/

Update: Actually, I need to track change in two matrix having Boolean values. T

9条回答
  •  你的背包
    2021-02-05 10:04

    Exclusive-OR is a linear function, but the definition of 'linear' with regards to a boolean function is not the same as with a polynomial function. You will have to look through the documentation for your lp_solve library to see if it is capable of handling linear boolean functions. From what I have read, I don't suspect that it can.

    Edit: After looking further into the simplex algorithm that lp_solve uses, I'm fairly certain that you can't do what you are trying to do.

提交回复
热议问题