Just a question that I\'m kind of confused about
So I was messing around with float(\'inf\')
and kind of wondering what it is used for.
Also I n
inf
is infinity - a value that is greater than any other value. -inf
is therefore smaller than any other value.
nan
stands for Not A Number, and this is not equal to 0
.
Although positive and negative infinity can be said to be symmetric about 0
, the same can be said for any value n
, meaning that the result of adding the two yields nan
. This idea is discussed in this math.se question.
Because nan
is (literally) not a number, you can't do arithmetic with it, so the result of the second operation is also not a number (nan
)