Why is this statement with bitwise operators the same as this if statement?

This question already has an answer here:

  • How is if-statement and bitwise operations same in this example? 4 answers

  • It first converts the comparison to subtraction with 128.

    Then the sign of the result (whether subtracting went below 128) is expanded to either all zeroes or all ones, which is and ed to the value being added, zeroing it out if the result of the subtraction was negative.

    链接地址: http://www.djcxy.com/p/934.html

    上一篇: 推荐将PDF嵌入到HTML中的方法?

    下一篇: 为什么这个语句在按位运算符和这个if语句相同?