Why double == NaN
/init
public double Error=0.0;
.
.
.
/looping
this.Error += Math.abs(instantError);
"Error" value using System.out.print()=NaN
what does that mean?
[184 byte] By [
kuku] at [2007-11-20 11:52:28]

# 1 Re: Why double == NaN
NaN means 'Not a Number'. From the Java Language Specification:
The IEEE 754 standard includes special Not-a-Number values (NaN). A NaN value is used to represent the result of certain invalid operations such as dividing zero by zero.
The variable 'instantError' in your code has a NaN value - it's invalid. For NaN values, Math.abs(..) just returns NaN.
The purpose of computing is insight, not numbers...
R. Hamming
dlorde at 2007-11-10 2:13:56 >
