Skip to content

Commit 220816c

Browse files
Explain throw
1 parent e214054 commit 220816c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

FindAFactor/_find_a_factor.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -644,9 +644,13 @@ struct Factorizer {
644644
x *= smoothNumberKeys[idx];
645645
}
646646
const BigInteger y = sqrt((x * x) % toFactor);
647-
// Uncomment to validate our math, overall
647+
// The WHOLE point of EVERYTHING we've done
648+
// is to guarantee this condition NEVER throws.
649+
// If we're finding solutions with the right
650+
// frequency as a function of rows saved,
651+
// we've correctly executed Quadratic sieve.
648652
if ((y * y) != ((x * x) % toFactor)) {
649-
throw std::runtime_error("Math is not self-consistent!");
653+
throw std::runtime_error("Quadratic sieve math is not self-consistent!");
650654
}
651655

652656
// Check x + y

0 commit comments

Comments
 (0)