Expand description
Module for factorizing integers
Modules§
- candidates
- There are many functions that can produce prime number candidates, but only a few that are guaranteed to produce all primes.
Structs§
- IntFactor
- A prime factor with its exponent (e.g., 2^3 means integer=2, exponent=3).
- Prime
Factors - The prime factorization of an integer, represented as a list of prime factors with their exponents.
- Prime
Numbers - An iterator that yields prime numbers in ascending order. Uses wheel factorization to generate candidates, filtering with Miller-Rabin (when available) for fast primality testing.
Functions§
- checked_
u128_ lcm - next_
prime - Return the smallest prime >= n.
- primefactor_
gcd - Calculate the Greatest common divisor (GCD) between 2 unsigned integers, returned as a prime factorization.
- u128_
gcd - Calculate the Greatest common divisor (GCD) between 2 unsigned integers. Based on Euclid’s algorithm pseudo code at: https://en.wikipedia.org/wiki/Euclidean_algorithm
- u128_
is_ prime - Test if the value is a prime number.
- u128_
lcm - Calculate the Least common multiple (LCM) for 2 integers.