The problem I feel is that
n / 0 does not throw an exception. Only
n ~/ 0 throws an
IntegerDivisionByZeroException. This is frankly completely unintuitive.
What even is the use of
double.infinity anyway? I think that it should be removed as I assume that there is no real use case that requires
double.infinity and could not be solved better.
I just encountered a problem that was incredibly hard to detect because my app was stuck in a loop (which I know now) and I did not even consider the possibility of
Infinity being used somewhere, which made any attempts of finding the issue harder.