diff --git a/library/math/prime_sieve/get_prime_factors.hpp b/library/math/prime_sieve/get_prime_factors.hpp index 1e728e50..7ea9284b 100644 --- a/library/math/prime_sieve/get_prime_factors.hpp +++ b/library/math/prime_sieve/get_prime_factors.hpp @@ -1,7 +1,6 @@ #pragma once #include "calc_sieve.hpp" -//! `fac` will equal all prime factors of num, increasing +//! `p` will be all prime factors of num, increasing //! @time O(log(num)) //! @space O(1) -for (int left = num, fac = sieve[left]; left > 1; - fac = sieve[left /= fac]) +for (int cpy = num, p; (p = sieve[cpy]) > 1; cpy /= p) \ No newline at end of file