Struct dimensioned::peano::Pred
[−]
[src]
pub struct Pred<N: NonPos> {
// some fields omitted
}For any non-positive Peano number N, we define its predecessor, Pred<N>.
This gives us negative Peano numbers.
Trait Implementations
impl<N: NonPos> Peano for Pred<N>
impl<N: NonPos> NonPos for Pred<N>
impl<N: NonPos> NonZero for Pred<N>
impl<Lhs, Rhs> Add<Rhs> for Pred<Lhs> where Lhs: NonPos + Add<Rhs>, Rhs: NonPos, Lhs::Output: NonPos
Add non-positive numbers to negative numbers (e.g. -2 + -3, -2 + 0)
impl<Lhs, Rhs> Add<Succ<Rhs>> for Pred<Lhs> where Lhs: NonPos + Add<Rhs>, Rhs: NonNeg
Add positive and negative numbers (e.g. -2 + 3)
impl<N> Neg for Pred<N> where N: NonPos + Neg, N::Output: NonNeg
Negate negative numbers (e.g. -5 -> 5)
impl<Lhs> Sub<Zero> for Pred<Lhs> where Lhs: NonPos
Subtract Zero from negative numbers (e.g. -2 - 0)
impl<Lhs, Rhs> Sub<Pred<Rhs>> for Pred<Lhs> where Lhs: NonPos + Sub<Rhs>, Rhs: NonPos
Subtract negative numbers from negative numbers (e.g. -3 - -4)
impl<Lhs, Rhs> Sub<Succ<Rhs>> for Pred<Lhs> where Lhs: NonPos + Sub<Rhs>, Rhs: NonNeg, Lhs::Output: NonPos
Subtract positive numbers from negative numbers (e.g. -3 - 4)
impl<Lhs, Rhs> Mul<Rhs> for Pred<Lhs> where Lhs: NonPos + Mul<Rhs>, Rhs: Peano, Lhs::Output: Sub<Rhs>
Multiply negative numbers by integers (e.g. -2 * N)
type Output = Lhs::Output::Output
fn mul(self, rhs: Rhs) -> Self::Output
impl<Lhs, Rhs> Div<Rhs> for Pred<Lhs> where Lhs: NonPos + Neg, Rhs: Neg, Succ<Lhs::Output>: DivPrivate<Rhs::Output>, Lhs::Output: NonNeg
Divide a negative number by a non-zero number (e.g. -4 / 2, -4 / -2). Only defined for numbers that are evenly divisible.