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

前端 未结 5 2014
误落风尘
误落风尘 2021-02-20 18:01

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:31

    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.

提交回复
热议问题