Did You Know Float(“NaN”) and Float(“inf”) Exist in Python?

NaN != NaN. Though inf == inf. But why?

Görkem Arslan
Better Programming
Published in
4 min readJan 28, 2022

--

Photo by Shubham Dhage on Unsplash

What are NaN and Inf?

For those who are unfamiliar with the notation of inf and NaN, they stand for infinity and Not-a-Number, respectively.

Even though infinity can be thought of as an extremely very large number, it has no end. We…

--

--