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, it's a "bigger than all the other numbers" number. Try subtracting anything you want from it, it doesn't get any smaller. All numbers are < Inf
. -Inf
is similar, but smaller than everything.
NaN
means not-a-number. If you try to do a computation that just doesn't make sense, you get NaN
. Inf - Inf
is one such computation. Usually NaN
is used to just mean that some data is missing.