Special floating point values

By passing certain strings to the float constructor, we can create the special floating point value NaN (short for Not a Number) and also positive and negative infinity:

>>> float("nan")
nan
>>> float("inf")
inf
>>> float("-inf")
-inf
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset