modify int_pow so that a power of -1 is valid
@@ -398,7 +398,7 @@ fn int_pow(&self, n1: Number, n2: Number) -> Result<Number, MachineStub> {
match (n1, n2) {
(Number::Fixnum(n1), Number::Fixnum(n2)) => {
- if n1 != 1 && n2 < 0 {
+ if n1 != 1 && n2 < -1 {
let n = Number::from(n1);
let stub = MachineError::functor_stub(clause_name!("^"), 2);
@@ -424,7 +424,7 @@ fn int_pow(&self, n1: Number, n2: Number) -> Result<Number, MachineStub> {
}
}
(Number::Fixnum(n1), Number::Integer(n2)) => {
- if n1 != 1 && &*n2 < &0 {
+ if n1 != 1 && &*n2 < &-1 {
let n = Number::from(n1);
let stub = MachineError::functor_stub(clause_name!("^"), 2);
@@ -442,7 +442,7 @@ fn int_pow(&self, n1: Number, n2: Number) -> Result<Number, MachineStub> {
}
}
(Number::Integer(n1), Number::Fixnum(n2)) => {
- if &*n1 != &1 && n2 < 0 {
+ if &*n1 != &1 && n2 < -1 {
let n = Number::Integer(n1);
let stub = MachineError::functor_stub(clause_name!("^"), 2);
@@ -460,7 +460,7 @@ fn int_pow(&self, n1: Number, n2: Number) -> Result<Number, MachineStub> {
}
}
(Number::Integer(n1), Number::Integer(n2)) => {
- if &*n1 != &1 && &*n2 < &0 {
+ if &*n1 != &1 && &*n2 < &-1 {
let n = Number::Integer(n1);
let stub = MachineError::functor_stub(clause_name!("^"), 2);
