fix: integer overflow when giving a small value as an argument

This commit is contained in:
2025-06-19 18:18:31 +02:00
parent fa19fc2789
commit 2fd839ae12

View File

@@ -76,7 +76,7 @@ int main(int argc, char** argv) {
ull msk = (1 << mod) - 1; // get a mask with the set word size
int cnt = __builtin_popcountll(*n & msk);
headsc += cnt;
tailsc += c - cnt;
tailsc += mod - cnt;
}
// print the results of this cycle