Expand description
Traits for using numbers as generic data types.
Traits§
- Integer
- Trait implemented by the primitive integer types.
- Number
- Trait implemented by the primitive number types, combining common supertraits.
- Signed
- Trait implemented by the primitive signed integer and floating point types.
- Signed
Integer - Trait implemented by the primitive signed integer types.
- Unsigned
Integer - Trait implemented by the primitive unsigned integer types.
Functions§
- chinese_
remainder - Solves a system of simultaneous congruences using the Chinese Remainder Theorem.
- egcd
- Computes the greatest common divisor (GCD) using the extended Euclidean algorithm.
- is_
prime - Checks if the provided unsigned integer
n
is a prime number. - lcm
- Computes the lowest common multiple (LCM).
- mod_
inverse - Computes the modular inverse of
a
modulob
if it exists. - mod_pow
- Calculates
base.pow(exponent) % modulus
.