<分区>
这question展示了一个非常有趣的现象:denormalized float 会使代码减慢一个数量级以上。
该行为在 accepted answer 中得到了很好的解释。 .然而,有一条评论,目前有 153 票,我找不到满意的答案:
Why isn't the compiler just dropping the +/- 0 in this case?!? – Michael Dorgan
旁注:我的印象是 0f 是/必须是完全可表示的(此外 - 它的二进制表示必须全为零),但在 c11 标准中找不到这样的声明。欢迎提供证明这一点的引文或反驳这一说法的论据。无论如何,Michael 的问题是这里的主要问题。
An implementation may give zero and values that are not floating-point numbers (such as infinities and NaNs) a sign or may leave them unsigned.