In [1]:
f_inf = float('inf')
In [2]:
print(f_inf)
In [3]:
print(type(f_inf))
In [4]:
f_inf_minus = -float('inf')
In [5]:
print(f_inf_minus)
In [6]:
print(type(f_inf_minus))
In [7]:
# print(int(f_inf))
# OverflowError: cannot convert float infinity to integer
In [8]:
print(str(f_inf))
In [9]:
print(type(str(f_inf)))
In [10]:
print(float('inf'))
In [11]:
print(float('infinity'))
In [12]:
print(float('INF'))
In [13]:
print(float('INFinity'))
In [14]:
import sys
In [15]:
f_inf_num = sys.float_info.max * 2
In [16]:
print(f_inf_num)