Module sp_arithmetic::traits [−][src]
Primitive traits for the runtime arithmetic.
Traits
AtLeast32Bit | A meta trait for arithmetic. |
AtLeast32BitUnsigned | A meta trait for arithmetic. Same as |
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 |
CheckedNeg | Performs negation 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. |
Signed | Useful functions for signed numbers (i.e. numbers that can be negative). |
UniqueSaturatedFrom | Just like |
UniqueSaturatedInto | Just like |
Unsigned | A trait for values which cannot be negative |
Zero | Defines an additive identity element for |
Functions
checked_pow | Raises a value to the power of exp, returning |