-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unsound Div, Rem #54
Comments
This should probably be fixed after or with #49 |
NB: |
looking again, |
Is there any chance of having a wrapping_simd_foo version that we could use instead? I suspect in practice the branching here will be very bad for performance. |
For |
fn main() {
println!("{}", -i32::MIN);
}
However...
So yeah! That one only panics in debug, actually. |
div/rem are heavyweight operations that this seems fine for, so long as the branch is correctly predicted against and sufficiently outlined the way normal int divs and such are. |
I think we have a separate issue on our hands which is re: whether or not add/sub/neg should overflow in Debug mode, and as such have removed that from this issue and into #56. |
Resolved by #55. |
The following should panic for integers:
neg(MIN)
div(MIN, -1)
rem(MIN, -1)
div(x, 0)
rem(x, 0)
The text was updated successfully, but these errors were encountered: