int a; …; (a == a) fails?

后端 未结 9 935
执笔经年
执笔经年 2020-12-31 19:05

if we set float and double type to NaN then they are not equal to anything including themselves.
can such a thing happens for

9条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-31 19:14

    Would depend on the compiler optimization maybe; look at the disassembly. If it uses binary 'and' it & check the flags after it will fail if a is zero.

提交回复
热议问题