且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Java 中,NaN 是什么意思?

更新时间:2023-12-03 23:14:16

摘自 本页:

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.