java.lang.Math#min(double, double):
public static double min(double a, double b) {
if (a != a) return a; // a is NaN
if (a == 0.0d && b == 0.0d && Double.doubleToLongBits(b) == negativeZeroDoubleBits) return b;
return (a <= b) ? a : b;
}
在什么情况下可以a != a
返回true
?似乎a
是NaN,但我无法想象一个例子。你能提供一个吗?