在 Java 中,NaN 是什么意思? [英] In Java, what does NaN mean?
本文介绍了在 Java 中,NaN 是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个程序试图将 double
缩小到所需的数字.我得到的输出是 NaN
.
I have a program that tries to shrink a double
down to a desired number. The output I get is NaN
.
NaN
在 Java 中是什么意思?
What does NaN
mean in Java?
推荐答案
摘自 本页:
NaN"代表非数字".楠"如果浮点数产生操作有一些输入参数导致操作产生一些未定义的结果.例如,0.0 除以 0.0 在算术上是未定义的.取a的平方根负数也是未定义的.
"NaN" stands for "not a number". "Nan" is produced if a floating point operation has some input parameters that cause the operation to produce some undefined result. For example, 0.0 divided by 0.0 is arithmetically undefined. Taking the square root of a negative number is also undefined.
这篇关于在 Java 中,NaN 是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文