在Python中,您可以执行以下操作:
test = float("inf")在Python 3.5中,您可以执行以下操作:
import mathtest = math.inf
接着:
test > 1test > 10000test > x
永远是真的。当然,除非指出,否则x也是无穷大或“ nan”(“非数字”)。
另外(Python的onLY 2.X)中,在比较
Ellipsis,
float(inf)较小,例如:
float('inf') < Ellipsis将返回true。

在Python中,您可以执行以下操作:
test = float("inf")在Python 3.5中,您可以执行以下操作:
import mathtest = math.inf
接着:
test > 1test > 10000test > x
永远是真的。当然,除非指出,否则x也是无穷大或“ nan”(“非数字”)。
另外(Python的onLY 2.X)中,在比较
Ellipsis,
float(inf)较小,例如:
float('inf') < Ellipsis将返回true。