Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Throw OverflowError on typemin(Int)//(-1) (JuliaLang#51085)
Fixes JuliaLang#32443 Currently `typemin(Int)//(-1) == typemin(Int)//(1)`, ignoring an overflow. As noted by @JeffreySarnoff in [JuliaLang#32443](JuliaLang#32443 (comment)) This should throw an error instead of silently overflowing. To fix this I am using `checked_neg` instead of `-` in the Rational constructor. With this PR `(-one(T))//typemin(T)` will now also throw an `OverflowError` instead of an `ArgumentError`
- Loading branch information