diff --git a/src/cryptonum/signed.rs b/src/cryptonum/signed.rs index 1fd0e28..b159024 100644 --- a/src/cryptonum/signed.rs +++ b/src/cryptonum/signed.rs @@ -152,7 +152,7 @@ impl<'a> DivAssign<&'a SCN> for SCN { let copy = self.value.contents.clone(); divmod(&mut self.value.contents, &mut remainder, ©, &rhs.value.contents); - if self.negative { + if self.negative && !remainder.is_empty() { let one = UCN{ contents: vec![1] }; self.sub_assign(SCN{ negative: false, value: one}); }