How could I implement logical implication with bitwise or other efficient code in C?

前端 未结 5 1564
没有蜡笔的小新
没有蜡笔的小新 2021-02-20 17:52

I want to implement a logical operation that works as efficient as possible. I need this truth table:

p    q    p → q
T    T      T
T    F      F
F    T      T
F         


        
5条回答
  •  逝去的感伤
    2021-02-20 18:32

    You can read up on deriving boolean expressions from truth Tables (also see canonical form), on how you can express any truth table as a combination of boolean primitives or functions.

提交回复
热议问题