问题
Why np.inf > 1e999
returns False?
I'm using Python 3.7
回答1:
The notation 1e999
results in a float -- and this float is larger than the maximum possible value. So 1e999
becomes inf
.
A quick test in Ipython:
In [11]: 1e999 == np.inf
Out[11]: True
来源:https://stackoverflow.com/questions/63585238/python-np-inf-not-larger-than-number