Prime number generator fails for large limit values

Bug #406593 reported by Scott Armitage
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyPE
New
Undecided
Scott Armitage

Bug Description

The prime number generator PyPE.pemath.primes(n) fails for large values of n. In particular, it appears that it fails for n > 2^31-1, the integer overflow limit -- this may be a limitation in Python on the size of a list.

Version information:
  Python: 2.6.2
  lp:pype : 7

Error information:

>>> PyPE.pemath.primes(600851475143)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "PyPE\pemath.py", line 92, in primes
    sieve = [True] * (n+1)
OverflowError: cannot fit 'long' into an index-sized integer

Changed in pype:
assignee: nobody → Scott Armitage (scott-armitage)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.