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, R0: Hex, C0: Hex, X0: Hex, H1, R1: Hex, C1: Hex, X1: Hex, H2, R2: Hex, C2: Hex, X2: Hex, H3, R3: Hex, C3: Hex, X3: Hex, H4, R4: Hex, C4: Hex, X4: Hex, H5, R5: Hex, C5: Hex, X5: Hex, H6, R6: Hex, C6: Hex, X6: Hex, H7, R7: Hex, C7, X7: Hex> TypedSub<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>where N::Hex0: HexNot<Output = X0>, N::Hex1: HexNot<Output = X1>, N::Hex2: HexNot<Output = X2>, N::Hex3: HexNot<Output = X3>, N::Hex4: HexNot<Output = X4>, N::Hex5: HexNot<Output = X5>, N::Hex6: HexNot<Output = X6>, N::Hex7: HexNot<Output = X7>, H0: HexAdd3<X0, _1, Output = R0, Carry = C0> + Hex, H1: HexAdd3<X1, C0, Output = R1, Carry = C1> + Hex, H2: HexAdd3<X2, C1, Output = R2, Carry = C2> + Hex, H3: HexAdd3<X3, C2, Output = R3, Carry = C3> + Hex, H4: HexAdd3<X4, C3, Output = R4, Carry = C4> + Hex, H5: HexAdd3<X5, C4, Output = R5, Carry = C5> + Hex, H6: HexAdd3<X6, C5, Output = R6, Carry = C6> + Hex, H7: HexAdd3<X7, C6, Output = R7, Carry = C7> + Hex, C7: HexAssertEqual<_1> + Hex,

§

type Output = TypedInteger<R0, R1, R2, R3, R4, R5, R6, R7>