Struct peano::Pred
[−]
[src]
pub struct Pred<N: NonPos> { /* 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: Copy + NonPos> Copy for Pred<N>
[src]
impl<N: Clone + NonPos> Clone for Pred<N>
[src]
fn clone(&self) -> Pred<N>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<N: NonPos> Peano for Pred<N>
[src]
impl<N: NonPos> NonPos for Pred<N>
[src]
impl<N: NonPos> NonZero for Pred<N>
[src]
impl<Lhs, Rhs> Add<Rhs> for Pred<Lhs> where
Lhs: NonPos + Add<Rhs>,
Rhs: NonPos,
<Lhs as Add<Rhs>>::Output: NonPos,
[src]
Lhs: NonPos + Add<Rhs>,
Rhs: NonPos,
<Lhs as Add<Rhs>>::Output: NonPos,
Add non-positive numbers to negative numbers (e.g. -2 + -3, -2 + 0)
type Output = Pred<<Lhs as Add<Rhs>>::Output>
The resulting type after applying the +
operator
fn add(self, rhs: Rhs) -> Self::Output
The method for the +
operator
impl<Lhs, Rhs> Add<Succ<Rhs>> for Pred<Lhs> where
Lhs: NonPos + Add<Rhs>,
Rhs: NonNeg,
[src]
Lhs: NonPos + Add<Rhs>,
Rhs: NonNeg,
Add positive and negative numbers (e.g. -2 + 3)
type Output = <Lhs as Add<Rhs>>::Output
The resulting type after applying the +
operator
fn add(self, rhs: Succ<Rhs>) -> Self::Output
The method for the +
operator
impl<N> Neg for Pred<N> where
N: NonPos + Neg,
<N as Neg>::Output: NonNeg,
[src]
N: NonPos + Neg,
<N as Neg>::Output: NonNeg,
Negate negative numbers (e.g. -5 -> 5)
type Output = Succ<<N as Neg>::Output>
The resulting type after applying the -
operator
fn neg(self) -> Self::Output
The method for the unary -
operator
impl<Lhs> Sub<Zero> for Pred<Lhs> where
Lhs: NonPos,
[src]
Lhs: NonPos,
Subtract Zero from negative numbers (e.g. -2 - 0)
type Output = Pred<Lhs>
The resulting type after applying the -
operator
fn sub(self, rhs: Zero) -> Self::Output
The method for the -
operator
impl<Lhs, Rhs> Sub<Pred<Rhs>> for Pred<Lhs> where
Lhs: NonPos + Sub<Rhs>,
Rhs: NonPos,
[src]
Lhs: NonPos + Sub<Rhs>,
Rhs: NonPos,
Subtract negative numbers from negative numbers (e.g. -3 - -4)
type Output = <Lhs as Sub<Rhs>>::Output
The resulting type after applying the -
operator
fn sub(self, rhs: Pred<Rhs>) -> Self::Output
The method for the -
operator
impl<Lhs, Rhs> Sub<Succ<Rhs>> for Pred<Lhs> where
Lhs: NonPos + Sub<Rhs>,
Rhs: NonNeg,
<Lhs as Sub<Rhs>>::Output: NonPos,
[src]
Lhs: NonPos + Sub<Rhs>,
Rhs: NonNeg,
<Lhs as Sub<Rhs>>::Output: NonPos,
Subtract positive numbers from negative numbers (e.g. -3 - 4)
type Output = Pred<Pred<<Lhs as Sub<Rhs>>::Output>>
The resulting type after applying the -
operator
fn sub(self, rhs: Succ<Rhs>) -> Self::Output
The method for the -
operator
impl<Lhs, Rhs> Mul<Rhs> for Pred<Lhs> where
Lhs: NonPos + Mul<Rhs>,
Rhs: Peano,
<Lhs as Mul<Rhs>>::Output: Sub<Rhs>,
[src]
Lhs: NonPos + Mul<Rhs>,
Rhs: Peano,
<Lhs as Mul<Rhs>>::Output: Sub<Rhs>,
Multiply negative numbers by integers (e.g. -2 * N)
type Output = <<Lhs as Mul<Rhs>>::Output as Sub<Rhs>>::Output
The resulting type after applying the *
operator
fn mul(self, rhs: Rhs) -> Self::Output
The method for the *
operator
impl<Lhs, Rhs> Div<Rhs> for Pred<Lhs> where
Lhs: NonPos + Neg,
Rhs: Neg,
Succ<<Lhs as Neg>::Output>: DivPrivate<<Rhs as Neg>::Output>,
<Lhs as Neg>::Output: NonNeg,
[src]
Lhs: NonPos + Neg,
Rhs: Neg,
Succ<<Lhs as Neg>::Output>: DivPrivate<<Rhs as Neg>::Output>,
<Lhs as Neg>::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.
type Output = <<Pred<Lhs> as Neg>::Output as DivPrivate<<Rhs as Neg>::Output>>::Output
The resulting type after applying the /
operator
fn div(self, rhs: Rhs) -> Self::Output
The method for the /
operator