-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
Julia's default integer division is checked. This occurs with division by 0, and typemin(T) ÷ -one(T).
LLVM deems either of these cases undefined behavior, which is very very bad because the compiler is allowed to do whatever it wants in that case. Also on Windows it may throw a Win32 exception that crashes Julia.
This is in contrast to +/-/*/^/abs where overflow has a defined result of wrapping around. And for example, C# doesn't stop checking division in an unchecked context. So it makes sense to not automatically follow this.
However, we could consider an option passed to the unchecked macros that allows people to opt in to unchecked division.
kimikage
Metadata
Metadata
Assignees
Labels
No labels