简体   繁体   English

Python - np.inf 不大于数字

[英]Python - np.inf not larger than number

Why np.inf > 1e999 returns False?为什么np.inf > 1e999返回 False?

I'm using Python 3.7我正在使用 Python 3.7

The notation 1e999 results in a float -- and this float is larger than the maximum possible value.符号1e999产生一个浮点数——这个浮点数大于可能的最大值。 So 1e999 becomes inf .所以1e999变成了inf

A quick test in Ipython: Ipython 中的快速测试:

In [11]: 1e999 == np.inf
Out[11]: True

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM