Module number

Source
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.
SignedInteger
Trait implemented by the primitive signed integer types.
UnsignedInteger
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 modulo b if it exists.
mod_pow
Calculates base.pow(exponent) % modulus.