如何判断 一个double 是不是 NaN

如题所述

打开 MATLAB Command window中输入 help NaN,可以看到 NaN(Not-a-Number) 的意思是“不是一个数字”。 NaN is the IEEE arithmetic representation for Not-a-Number. A NaN is obtained as a result of mathematically undefined operations l
温馨提示:答案为网友推荐,仅供参考
第1个回答  2018-03-20
判断一个数是否是NaN
要这样写:Double.isNaN(d)
若写成 d==Double.NaN是不行滴!
如果是Double类型,还有一个d.isNaN()方法可以判断
其他类型类推
相似回答