Whoops. Don't correct for rounding if there's no remainder on the division.
This commit is contained in:
@@ -152,7 +152,7 @@ impl<'a> DivAssign<&'a SCN> for SCN {
|
|||||||
let copy = self.value.contents.clone();
|
let copy = self.value.contents.clone();
|
||||||
divmod(&mut self.value.contents, &mut remainder,
|
divmod(&mut self.value.contents, &mut remainder,
|
||||||
©, &rhs.value.contents);
|
©, &rhs.value.contents);
|
||||||
if self.negative {
|
if self.negative && !remainder.is_empty() {
|
||||||
let one = UCN{ contents: vec![1] };
|
let one = UCN{ contents: vec![1] };
|
||||||
self.sub_assign(SCN{ negative: false, value: one});
|
self.sub_assign(SCN{ negative: false, value: one});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user