Whoops. Don't correct for rounding if there's no remainder on the division.

This commit is contained in:
2018-04-04 18:13:50 -04:00
parent ae6a33f4b8
commit f06f83583f

View File

@@ -152,7 +152,7 @@ impl<'a> DivAssign<&'a SCN> for SCN {
let copy = self.value.contents.clone();
divmod(&mut self.value.contents, &mut remainder,
&copy, &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});
}