In [1]:
import math
import numpy as np
In [2]:
print(1e1000)
In [3]:
print(1e100)
In [4]:
print(1e1000 == float('inf'))
In [5]:
print(1e100 == float('inf'))
In [6]:
print(float('inf') == math.inf == np.inf)
In [7]:
print(1e1000 == math.inf)
In [8]:
print(1e100 == math.inf)
In [9]:
print(float('inf') == float('inf') * 100)
In [10]:
print(math.isinf(1e1000))
In [11]:
print(math.isinf(1e100))
In [12]:
print(math.isinf(-1e1000))
In [13]:
print(np.isinf(1e1000))
In [14]:
print(np.isinf(1e100))
In [15]:
print(np.isinf(-1e1000))
In [16]:
a_inf = np.array([1, np.inf, 3, -np.inf])
In [17]:
print(a_inf)
In [18]:
print(type(a_inf))
In [19]:
print(np.isinf(a_inf))
In [20]:
a_inf[np.isinf(a_inf)] = 0
In [21]:
print(a_inf)
In [22]:
import sys
In [23]:
print(sys.float_info.max)
In [24]:
print(float('inf') > sys.float_info.max)
In [25]:
print(-float('inf') < -sys.float_info.max)
In [26]:
print(float('nan'))
In [27]:
print(type(float('nan')))
In [28]:
print(float('inf') > float('nan'))
In [29]:
print(float('inf') < float('nan'))
In [30]:
print(float('inf') == float('nan'))
In [31]:
print(float('inf') > 100)
In [32]:
large_int = int(sys.float_info.max) * 10
In [33]:
print(large_int)
In [34]:
print(type(large_int))
In [35]:
print(large_int > sys.float_info.max)
In [36]:
print(float('inf') > large_int)
In [37]:
print(float(10**308))
In [38]:
# print(float(10**309))
# OverflowError: int too large to convert to float