use correct signs in fixnum remainders

This commit is contained in:
Mark Thom
2020-04-18 17:37:54 -06:00
parent 1d964ef921
commit 2c8858ff2d
4 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,5 @@
use crate::divrem::*;
use crate::prolog_parser::ast::*;
use crate::prolog::arithmetic::*;
@@ -990,7 +992,7 @@ impl MachineState {
stub,
))
} else {
Ok(Number::from(n1 % n2))
Ok(Number::from(n1.rem_floor(n2)))
}
}
(Number::Fixnum(n1), Number::Integer(n2)) => {