CKTIS / Python
math.inf
Označuje pozitivno neskončnost tipa float.
Različica: Python 3.14; repository image, production runtime not attested
Sintaksa
math.infOznačuje pozitivno neskončnost tipa float.
Vsako končno realno število, tudi deset na stoto potenco, je manjše. Negacija da negativno neskončnost, ki jo prepozna isinf.
Primerjava math.nan < math.inf da False.
import math
assert -math.inf < -(10**100) < 10**100 < math.inf
assert not (math.nan < math.inf) and math.isinf(-math.inf)
Primeri
import math
print(math.inf > 10 ** 100)
print(math.isinf(-math.inf))
Rezultat
True True
Primerjava `math.nan < math.inf` da False.