From here
The IEEE floating point standard, supported by almost all modern processors, indicates that every floating point arithmetic operation, including division by zero, has a well-defined result. The standard supports signed zero, as well as infinity and NaN (rather than a number). There are two zeros, +0 (positive zero) and -0 (negative zero), and this eliminates any ambiguity in the division. In arithmetic, IEEE 754 Γ· + 0 is positive infinity when a is positive, negative infinity when a is negative, and NaN when a = Β± 0. Signs of infinity change when divided by -0 instead.
Integer division by zero is usually handled differently than floating point, because there is no integer representation for the result. Some processors throw an exception when an attempt is made to divide an integer by zero, although others will simply continue and generate the wrong result for division. The result depends on how the division is performed, and can be either zero or sometimes the largest possible integer.
stacker
source share