[−][src]Module sp_arithmetic::traits
Primitive traits for the runtime arithmetic.
Traits
| AtLeast32Bit | A meta trait for arithmetic. |
| BaseArithmetic | A meta trait for arithmetic type operations, regardless of any limitation on size. |
| Bounded | Numbers which have upper and lower bounds |
| CheckedAdd | Performs addition that returns |
| CheckedDiv | Performs division that returns |
| CheckedMul | Performs multiplication that returns |
| CheckedShl | Performs a left shift that returns |
| CheckedShr | Performs a right shift that returns |
| CheckedSub | Performs subtraction that returns |
| IntegerSquareRoot | A trait implementing integer square root. |
| One | Defines a multiplicative identity element for |
| SaturatedConversion | Convenience type to work around the highly unergonomic syntax needed
to invoke the functions of overloaded generic traits, in this case
|
| Saturating | Saturating arithmetic operations, returning maximum or minimum values instead of overflowing. |
| UniqueSaturatedFrom | Just like |
| UniqueSaturatedInto | Just like |
| Zero | Defines an additive identity element for |
Functions
| checked_pow | Raises a value to the power of exp, returning |