use core::cmp::max;
use core::fmt::{Debug, Formatter};
-use core::ops::{Add, Mul};
+use core::ops::{Add, Sub, Mul};
type Word = u64; // element type of the vectors we use
const WORDLEVELS: usize = 6; // 2^{2^6} = 64 = size of Word
}
}
+impl<'a, 'b> Sub<FiniteNimberRef<'a>> for FiniteNimberRef<'b> {
+ type Output = FiniteNimber;
+ fn sub(self, other: FiniteNimberRef<'a>) -> FiniteNimber { self + other }
+}
+
impl<'a> FiniteNimberRef<'a> {
fn mul_by_h(self, level: usize) -> FiniteNimber {
match level.checked_sub(1) {
}
impl_binop_wrappers!(Add, add);
+impl_binop_wrappers!(Sub, sub);
impl_binop_wrappers!(Mul, mul);
#[cfg(test)]