pub trait HexAdd<H: Hex> {
type Output: Hex;
type Carry: Hex;
}
Expand description
This is an internal implementation of addition of 2 number
Example
use const_arithmetic::*;
let a = _F;
let b = _6;
let result = _5;
let overflow = _1;
// This verifies 15 + 6 = 21
fn hex_add<H1, H2, B, C>(_h1: H1, _h2: H2, _b: B, _c: C) where
H1: Hex,
H2: Hex,
B: Hex,
C: Hex,
H1: HexAdd<H2, Output = B, Carry = C>
{}
hex_add(a, b, result, overflow);