1
Fork 0

Fix bug in wrapping_div

See discussion, albeit one-sided, in:

  https://github.com/rust-lang/rfcs/issues/964
This commit is contained in:
Felix S. Klock II 2015-04-14 18:44:14 +02:00
parent 4991c7acad
commit d8122ee87d

View file

@ -232,7 +232,7 @@ macro_rules! signed_overflowing_impl {
#[inline(always)] #[inline(always)]
fn overflowing_div(self, rhs: $t) -> ($t, bool) { fn overflowing_div(self, rhs: $t) -> ($t, bool) {
if self == $t::MIN && rhs == -1 { if self == $t::MIN && rhs == -1 {
(1, true) (self, true)
} else { } else {
(self/rhs, false) (self/rhs, false)
} }