In Python 2.7 Unendlichkeit als Ganzzahl darstellen
Ich frage mich, wie man @ definieinf
und-inf
alsint
in Python 2.7. Ich habe es versucht und es scheintinf
und-inf
nur als @ arbeitfloat
.
a = float('-inf') # works
b = float('inf') # works
c = int('-inf') # compile error, ValueError: invalid literal for int() with base 10: 'inf'
d = int('inf') # compile error, ValueError: invalid literal for int() with base 10: 'inf'