Expand description
This crate is dedicated to implementing integer arithmetic that can be verified and used during compilation time
Macros§
- parse_
integer - Turns an integer (u32) into a typed integer object.
- typed_
assert_ eq - This asserts the typed integer provided is the same as the number you provided
Structs§
- Phantom
Data - Zero-sized type used to mark things that “act like” they own a
T
. - Typed
Integer - A struct which generics represents an unique integer from 0 to 2 ** 32 - 1
- _0
- This denotes the number 0
- _1
- This denotes the number 1
- _2
- This denotes the number 2
- _3
- This denotes the number 3
- _4
- This denotes the number 4
- _5
- This denotes the number 5
- _6
- This denotes the number 6
- _7
- This denotes the number 7
- _8
- This denotes the number 8
- _9
- This denotes the number 9
- _A
- This denotes the number 10
- _B
- This denotes the number 11
- _C
- This denotes the number 12
- _D
- This denotes the number 13
- _E
- This denotes the number 14
- _F
- This denotes the number 15
Traits§
- Assert
False - Asserts that a binary equals to _0
- Assert
True - Asserts that a binary equals to _1
- BinAnd
- The AND logic gate
- BinEq
- The NXOR logic gate, or EQUAL operator
- BinNor
- The NOR logic gate
- BinNot
- The NOT logic gate
- BinOr
- The OR logic gate
- Binary
- Indicates binary types.
- Hex
- This denotes one single hexadecimal - half a byte
- HexAdd
- This is an internal implementation of addition of 2 number
- HexAdd3
- This is an internal implementation of addition of three number
- HexAssert
Equal - This is an internal implementation of asserted equality on hexadecimal.
- HexEqual
- This is an internal implementation of equality on hexadecimal. False evaluates to _0 and true evaluates to _1
- HexMul
- This is an internal implementation of multiplication of two hexadecimal
- IsInteger
- A trait that denotes whether something is an integer Example
- Typed
Add - Denotes integer addition. If this says C7 does not implement HexAssertEq, this means it overflowed.
- Typed
Assert Equal - A trait that asserts two integers are equal Example
- Typed
Div - Returns the Quotient of H/K for H: Div<K, Output: …>
- Typed
Equal - A trait that returns a binary depending on whether two integers are equal
- Typed
Geq - A trait that returns a binary depending on whether two integers are greater or equal
- Typed
Greater Than - A trait that returns a binary depending on whether a > b
- Typed
Leq - A trait that returns a binary depending on whether two integers are less or equal
- Typed
Less Than - A trait that returns a binary depending on whether a < b
- Typed
Mul - A multiplication of 32 bit number and 32 bit number can be stored safely in a 64 bit number. We represent them as lower 32 bits and upper 32 bits
- Typed
Sub - Denotes integer subtraction. If this says C7 does not implement HexAssertEq, this means it underflowed.