3 ms·
Thanks -- scipy.weave looks to do the trick! BTW, while that linked code is a good example of how weave works, it's a bad example of when to use it. I've no d
by CUViper 18y ago
Thanks -- scipy.weave looks to do the trick!
BTW, while that linked code is a good example of how weave works, it's a bad example of when to use it. I've no doubt that the code runs faster with that portion written in C, but a different algorithm could blow it away. A prime generator like that would be MUCH faster with a sieve, even in pure Python.
- albertcardona 18y agoThat code was proof of principle, just playing. No claim to have written any particularly efficient prime number generator. I'm glad you found it instructive.