# HG changeset patch # User Arun Giridhar # Date 1669211929 18000 # Node ID 88d2395500e7eeb523381da23113e1fc70946b37 # Parent cb5d5c9d9c14f8f5fb34e9417e9b14933f272f7a __isprimelarge__.cc: Shorten long lines __isprimelarge__.cc: After testing, it turns out that marking constants with ULL or UINT64_C is not required for this code. Removing those markers shortens all long lines to <80 characters. diff -r cb5d5c9d9c14 -r 88d2395500e7 libinterp/corefcn/__isprimelarge__.cc --- a/libinterp/corefcn/__isprimelarge__.cc Wed Nov 23 05:22:46 2022 -0500 +++ b/libinterp/corefcn/__isprimelarge__.cc Wed Nov 23 08:58:49 2022 -0500 @@ -213,12 +213,12 @@ // factorization algorithm with Brent update. // The code is short and simple, but the math behind it is complicated. uint64_t -pollardrho (uint64_t n, uint64_t c = UINT64_C (1)) +pollardrho (uint64_t n, uint64_t c = 1) { - uint64_t i = UINT64_C (1), j = UINT64_C (2); // cycle index values - uint64_t x = (c+1) % n; // can also be rand () % n - uint64_t y = x; // other value in the chain - uint64_t g = 0; // GCD + uint64_t i = 1, j = 2; // cycle index values + uint64_t x = (c+1) % n; // can also be rand () % n + uint64_t y = x; // other value in the chain + uint64_t g = 0; // GCD while (true) { @@ -238,10 +238,10 @@ j <<= 1; } - if (g == n || i > UINT64_C (1000000)) // cut losses, restart with a different c + if (g == n || i > 1000000) // cut losses, restart with a different c return pollardrho (n, c + 2); - if (g > UINT64_C (1)) // found GCD ==> exit loop properly + if (g > 1) // found GCD ==> exit loop properly { error_unless (n % g == 0); // theoretical possibility of GCD error return g;