19 int64_t n = 9223372036854775803;
23 std::cout <<
"The smallest prime factor of " << n <<
" is " << factor
34 std::vector<uint64_t> nums_to_factorize = {
35 9223372036854775803, 9223372036854775807, 9223372036854775303,
36 4567890123456789LL, 5678901234567890LL, 6789012345678901LL,
37 7890123456789012LL, 8901234567890123LL, 9999999967LL,
38 12345678901234567LL, 987654321987654321LL, 2147483647LL,
39 9223372036854775783LL, 1311768467463790320LL, 7237005577332262210LL,
40 3037000499LL, 2305843009213693951LL, 2305843009213693967LL,
41 2305843009213693971LL, 2305843009213693973LL, 2305843009213693977LL,
42 2305843009213693989LL};
51 std::vector<std::future<uint64_t>> results;
54 for (
const auto &num : nums_to_factorize) {
62 for (
auto &
res : results) {
63 std::cout <<
res.get() << std::endl;
uint64_t pollard_rho(uint64_t n)
A class that provides a function to dispatch a function call to a thread pool and return a future obj...