【问题标题】:Factoring a logical expression containing bitwise operators AND and SHIFT分解包含按位运算符 AND 和 SHIFT 的逻辑表达式
【发布时间】:2012-04-24 17:40:09
【问题描述】:

我有一个这样的逻辑表达式: (A

(A

谁能说出 op1 和“(任何不包含 A)”的运算符是什么?或者这是否可能?

【问题讨论】:

    标签: refactoring operators logic bitwise-operators


    【解决方案1】:

    我认为这是不可能的,我能做的最好的就是移动其中一个班次

    assuming k > l (otherwise switch them)
    
    A & ( A << (k-l) ) << l
    

    但这显然不是你想要的

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-18
      • 1970-01-01
      • 1970-01-01
      • 2017-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多