如果我写道:
int x = /* any non-zero integer value */; float y = x; float z = y / y;
z保证恰好是1.f吗?
z
发布于 2017-06-30 20:32:27
不,不是在所有的情况下,即使是对IEEE754。
例如,使用int x = 0;,您将获得NaN。(Live)
int x = 0;
https://stackoverflow.com/questions/44846512
相似问题