When does java print Infinity and when does it print NaN?
Why is 1.0/0.0 infinity but ((1.0/0.0) - (1.0/0.0)) NaN and 0.0f/0.0f an NaN?
What is the difference between these two?
Because Java is following known math facts. 1.0 / 0.0 is infinity, but the others are indeterminate forms, which Java represents as NaN (not a number).
NaN
2.1m questions
2.1m answers
60 comments
57.0k users