I have a program that tries to shrink a double
down to a desired number. The output I get is NaN
.
What does NaN
mean in Java?
Taken from this page:
"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.