using System;
public class Test
{
public static void Main()
{
double b=1.1;
double c=double.NaN;
Console.WriteLine("b="+b);
Console.WriteLine("c="+c);
Console.WriteLine("b==double.NaN: "+(b==double.NaN));
Console.WriteLine("double.IsNaN(b): "+double.IsNaN(b));
Console.WriteLine("c==double.NaN: "+(c==double.NaN));
Console.WriteLine("double.IsNaN(c): "+double.IsNaN(c));
}
}
运行结果:文章来源:https://www.toymoban.com/news/detail-691194.html
b=1.1
c=NaN
b==double.NaN: False
double.IsNaN(b): False
c==double.NaN: False
double.IsNaN( c): True文章来源地址https://www.toymoban.com/news/detail-691194.html
到了这里,关于【c#】判断double值是否等于NaN的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!