Skip to main content

primefactor_gcd

Function primefactor_gcd 

Source
pub fn primefactor_gcd(this: u128, that: u128) -> PrimeFactors
Expand description

Calculate the Greatest common divisor (GCD) between 2 unsigned integers, returned as a prime factorization.

Handles the identity gcd(0, n) = n by returning the other value’s factorization. Since gcd(0, 0) = 0 has no prime factorization, it returns an empty result. For a simpler numeric GCD, use u128_gcd.