Prime number algo... what's wrong?

sismex01 at hebmex.com sismex01 at hebmex.com
Thu Mar 27 20:47:38 CET 2003


>
> ...
> As for implementing it in Python, you'd often want to handle 
> oversized integers; is there some extended precision Python
> math module already written, or is it better to farm out work
> like this to a bc or dc  script?   
> 

All of the above ;-)

Python's long integers are only constrained by memory, so you
could use them.

You could also make a python module to write a bc or dc script
and popen() it, fetching back all results.

Or, you could also use the Python extension module which
adapts the GNU multiprecision math library, or some other
library (there's several, Google's your close personal friend).

HTH!

-gus

pd: hmm... isn't there supposed to be only one way to do it?





More information about the Python-list mailing list