Closed gurgalex closed 7 years ago
It will be at least as large as the number passed to new, but may be slightly larger.
I guess the only issue is that crash info and core dumps are exposed to Python.
Well that's interesting. I guess we need to add a check in Sieve.is_prime()
which checks the number being queried is lower than the limit
and throws an exception if that's not the case.
The primal documentation explains the crash
If n is out of range (greater than self.upper_bound()), is_prime will panic.
I don't know if this is a bug, but here are some test cases that do and don't produce
Index out of Bound
CrashesUpper bound reports that the largest number known about is
10
limit=8 does not crash
Upper bound returns
12
So, it will crash if the number being checked is greater than the upper bound. The primal docs seem to say that it will sieve out all primes up to
limit
. What is limit?