Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
为什么是
Double.NaN != Double.longBitsToDouble(Double.doubleToRawLongBits(Double.NaN));
尽管SE 6 文档说明了以下内容:
在所有情况下,结果都是一个long整数,当将其提供给 longBitsToDouble(long)方法时,将产生一个与 的参数相同的浮点值doubleToRawLongBits。
long
longBitsToDouble(long)
doubleToRawLongBits
但是Double.NaN != Double.NaN...
Double.NaN != Double.NaN