Trait TypedSub

Source
pub trait TypedSub<N: IsInteger> {
    type Output: IsInteger;
}
Expand description

Denotes integer subtraction. If this says C7 does not implement HexAssertEq, this means it underflowed.

Example

use const_arithmetic::*;
let a = parse_integer!(7);
let b = parse_integer!(4);
let c = parse_integer!(3);
 
// This verifies that 7 - 4 = 3
fn example<P, Q, R>(_p: P, _q: Q, _r: R) where
P: IsInteger,
Q: IsInteger,
R: IsInteger,
P: TypedSub<Q, Output = R>
{}
 
example(a, b, c);

Required Associated Types§

Implementors§

Source§

impl<N: IsInteger, H0: Hex, H1: Hex, H2: Hex, H3: Hex, H4: Hex, H5: Hex, H6: Hex, H7: Hex, R: IsInteger> TypedSub<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>
where TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>: _Sub<N, Output = R>,