So Python has positive and negative infinity:
float("inf"), float("-inf")
This just seems like the type of feature that has to have some caveat. Is there anything I should be aware of?
So Python has positive and negative infinity:
float("inf"), float("-inf")
This just seems like the type of feature that has to have some caveat. Is there anything I should be aware of?
A VERY BAD CAVEAT : Division by Zero
in a 1/x fraction, up to x = 1e-323 it is inf but when x = 1e-324 or little it throws ZeroDivisionError
>>> 1/1e-323
inf
>>> 1/1e-324
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ZeroDivisionError: float division by zero
so be cautious!