Speed of Comparison operators

后端 未结 6 2286
走了就别回头了
走了就别回头了 2020-12-19 08:45

In languages such as... well anything, both operators for < and <= (and their opposites) exist. Which would be faster, and how are they interpreted?

6条回答
  •  难免孤独
    2020-12-19 09:34

    What data-type?

    If y is INT_MAX, then the first expression is true no matter what x is (assuming x is the same or smaller type), while the second expression is always false.

    If the answer doesn't need to be right, you can get it even faster.

提交回复
热议问题