diff options
Diffstat (limited to 'doc/examples')
-rw-r--r-- | doc/examples/factor.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/doc/examples/factor.cpp b/doc/examples/factor.cpp index b7b116159..b8e02e19f 100644 --- a/doc/examples/factor.cpp +++ b/doc/examples/factor.cpp @@ -45,6 +45,7 @@ BigInt rho(const BigInt& n) return 0; } +// Remove (and return) any small (< 2^16) factors std::vector<BigInt> remove_small_factors(BigInt& n) { std::vector<BigInt> factors; @@ -86,12 +87,6 @@ std::vector<BigInt> factorize(const BigInt& n_in) BigInt n = n_in; std::vector<BigInt> factors = remove_small_factors(n); - if(is_prime(n)) - { - factors.push_back(n); - return factors; - } - while(n != 1) { if(is_prime(n)) |