pub trait TypedLessThan<N: IsInteger> {
    type Output: Binary;
}
Expand description

A trait that returns a binary depending on whether a < b

Example

use const_arithmetic::*;
let a = parse_integer!(3);
 
// This verifies that a <= 5 but not a < 3
fn example<T, R, S>(_a: T) where
T: IsInteger,
R: Binary,
S: Binary,
T: TypedLessThan<TypedInteger<_3, _0, _0, _0, _0, _0, _0, _0>, Output = R>,
R: AssertFalse,
T: TypedLessThan<TypedInteger<_5, _0, _0, _0, _0, _0, _0, _0>, Output = S>,
S: AssertTrue
{}
 
example(a);

Required Associated Types§

Implementors§

source§

impl<N, 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, R_, Eq, NotEq: Binary, R: Binary> TypedLessThan<N> for TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>where N: TypedEqual<TypedInteger<H0, H1, H2, H3, H4, H5, H6, H7>, Output = Eq> + IsInteger, Eq: BinNot<Output = NotEq> + Binary, 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: HexEqual<_0, Output = R_> + Hex, R_: BinAnd<NotEq, Output = R> + Binary,

§

type Output = R