Skip to main content

Module factor

Module factor 

Source

Functions§

factorize
Return the sorted list of prime factors of n (with repetition).
format_factors
Format a factorization result as “NUMBER: FACTOR FACTOR …” matching GNU factor output. Writes directly to a buffer to avoid per-number String allocation.
write_factors
Write factorization of a u128 to a buffer. Falls through to the u64 fast path when possible.
write_factors_u64
Write factorization of a u64 directly to a buffer. Zero-allocation hot path for the common case (numbers up to 2^64-1).