Hello!
I am currently making my way through the documentation, and I was wondering why the floating point division operator doesn’t throw the same errors as the integer division function. In the documentation, it says:
" Integer division (the div
function) has two exceptional cases: dividing by zero, and dividing the lowest negative number ( typemin
) by -1. Both of these cases throw a DivideError
. The remainder and modulus functions ( rem
and mod
) throw a DivideError
when their second argument is zero."
When I do these same operations with the ‘/’ operator, I get:
julia> 1/0
Infjulia> typemin(Int64)/-1
9.223372036854776e18
Why don’t these same errors get thrown when I do floating point division with the ‘/’ operator?
Edit:
I should have read a little bit further before posting. It says a little bit after that this is the result of the IEEE 754 standard.