谁可以给我解释一下这个?在C#中double.NaN不等于double.NaN
bool huh = double.NaN == double.NaN; // huh = false bool huh2 = double.NaN >= 0; // huh2 = false bool huh3 = double.NaN <= 0; // huh3 = false
我可以将哪个常量与double.NaN进行比较,然后得出真值?
如果您很好奇,这是Double.IsNaN这样的:
Double.IsNaN
public static bool IsNaN(double d) { return (d != d); }
时髦吧?