是的,试试这个......
public class Main
{
public static void main(String[] args)
{
double a = Double.NaN;
if( a == a ) System.out.println("equal");
}
}
Run Code Online (Sandbox Code Playgroud)
是,for float或double NaNs(但不是Float或Double).JLS第3版的第4.2.3节.我相信IEEE 754以这种方式定义了操作.这是唯一的案例.