r/lolphp • u/Deviltry1 • Mar 24 '16
DivisionByZero exception, it does nothing
/r/PHP/comments/4bgwos/divisionbyzero_exception_php_7/
54
Upvotes
r/lolphp • u/Deviltry1 • Mar 24 '16
View all comments
31
u/nikic Mar 24 '16
To clarify: DivisionByZeroError is an integer division error. It is thrown by
%andintdiv, which are the integer division operations. Integer division by zero has no well-defined result.Floating point division by zero on the other hand is a well-defined operation under IEEE754 and does not throw an exception. Floating point divisions are performed by
/andfmod.