Rubyとかではお馴染みのinfinityをPythonでつかおう!
a = float('inf')
これで呼び出せる。
a = float('inf')
a - 1.0
Out[3]: inf
1.0 - a
Out[4]: -inf
a - a
Out[5]: nan
nanはNoneとは異なる、不動小数点型によって定義された一つの「数」です。
ちなみに
b = float(1 / 0)
Traceback (most recent call last):
略
float(1 / 0)
ZeroDivisionError: division by zero
wheel theoryにはのっとっていないようです。
完