# Divide by zero and modulo zero. # # Division: Use the common convention that x / 0 is inf with the same sign # as x, except when x = 0, where we return NaN. This is also what earlier # versions did. # # Modulo: In modular arithmetic, the congruence relation z = x (mod y) # means that there is some integer k such that z - x = k y. If y = 0, we # get z - x = 0 or z = x. This is also what earlier versions did, except # that 0 % 0 returned NaN. # # inf / 0 = inf inf % 0 = inf # 5 / 0 = inf 5 % 0 = 5 # 0 / 0 = NaN 0 % 0 = 0 # -5 / 0 = -inf -5 % 0 = -5 # -inf / 0 = -inf -inf % 0 = -inf