On 02/25/2015 12:55 PM, Jeroen Demeyer wrote:
> Hello,
> 
> Should there be code in Sage which is extremely slow and for educational 
> purposes only? I am talking about eratosthenes() which is just a very 
> slow alternative to prime_range().
> 
> I would just remove that code, but maybe people have other opinions...
> 

It's nice to leave in code like this and use it as part of the test
suite. It would be easy to check that the sieve of Eratosthenes is
correct, but prime_range() is a long chain of dark magic to me.

A good test would be that they agree on the primes below (say) 1,000:

  sage: eratosthenes(1000) == prime_range(1000)
  True

There are some tests for prime_range() already, e.g.

  sage: L = prime_range(25000,2500000)
  sage: len(L)
  180310

but who knows if the results are correct.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to