Questions tagged «ocpjp»

9
为什么Double.NaN == Double.NaN返回false?
我刚刚研究OCPJP问题,发现了这个奇怪的代码: public static void main(String a[]) { System.out.println(Double.NaN==Double.NaN); System.out.println(Double.NaN!=Double.NaN); } 运行代码时,我得到: false true false当我们比较看起来彼此相同的两件事时,输出如何?什么NaN意思
155 java  floating-point  nan  scjp  ocpjp 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.