Crate comlib_math[−][src]
Expand description
Comlib Math Utilities
This library contains some commonly used math utilities.
Content
- Greatest common divisor
- Modular integers
- Sieve of Eratosthenes
- Primality test
- Factorization
- Modular exponentiation
- Finding next permutation of a list
- Iterating over subsets
Still missing
- Fourier Transform, both number theoretic and complex
Re-exports
pub use subsets::subsets;Modules
Module containing functions and structs for iterating subsets.
Structs
Commonly used modulus 10⁹ + 7.
Integer type for which all computations are executed in modulo given by M::modulus.
Sieve of Eratosthenes.
A quotient. Represents a rational number as numerator/denominator.
Modulus whose value can be selected at runtime.
Modulus whose value can be selected at runtime.
Enums
Sign of a number.
Traits
Trait implemented by floating-point numbers.
Trait implemented by integral types.
Marker trait for indicating that modular numbers in this modulo can be inverted.
Trait implemented by numeric types which cannot contain 0.
Trait implemented by numeric types.
Trait implemented by signed numbers.
Functions
Factorizes the given integer into its prime factors.
Computes the greatest common divisor of the given numbers.
Checks whether a given number is a prime.
Computes the least common multiple of the given numbers.
Raises base to given exponent in the given modulus.
Computes lexicographically next smallest permutation.