Skip to content

Commit 4769540

Browse files
Debug thread range
1 parent f839743 commit 4769540

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,9 +824,9 @@ struct Factorizer {
824824
BigInteger perfectSquare = 1U;
825825
std::vector<size_t> fv(primes.size(), 0);
826826
while (perfectSquare < toFactor) {
827-
const BigInteger bIndex = threadOffset + (dis(gen) % threadRange);
828-
const BigInteger halfBIndex = batchOffset + (bIndex >> 1U) + 1U;
829-
const BigInteger bNum = (bIndex & 1U) ? batchTotal - halfBIndex : halfBIndex;
827+
const BigInteger bIndex = dis(gen) % threadRange;
828+
const BigInteger halfBIndex = threadOffset + (bIndex >> 1U) + 1U;
829+
const BigInteger bNum = (bIndex & 1U) ? halfBIndex : (batchTotal - halfBIndex);
830830
BigInteger n = forwardFn((bNum * wheelEntryCount) + (dis(gen) % wheelEntryCount));
831831
const std::vector<size_t> pfv = factorizationVector(&n);
832832
if (!pfv.size()) {

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
88

99
[project]
1010
name = "FindAFactor"
11-
version = "4.7.5"
11+
version = "4.7.6"
1212
requires-python = ">=3.8"
1313
description = "Find any nontrivial factor of a number"
1414
readme = {file = "README.txt", content-type = "text/markdown"}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def build_extension(self, ext):
4040

4141
setup(
4242
name='FindAFactor',
43-
version='4.7.5',
43+
version='4.7.6',
4444
author='Dan Strano',
4545
author_email='stranoj@gmail.com',
4646
description='Find any nontrivial factor of a number',

0 commit comments

Comments
 (0)