posted 14 years ago
"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.
0.0 / 0.0 -> NaN
Math.sqrt(-2.0) -> NaN
Refer The following example:
Saravanan
SCJP 5.0(98%), SCWCD 5.0 (100%), OCA