Subject: | sieve_primes() base==num |
Date: | Thu, 14 Oct 2010 10:51:13 +1100 |
To: | bug-Math-Prime-XS [...] rt.cpan.org |
From: | Kevin Ryde <user42 [...] zip.com.au> |
Is there a reason to disallow base==num in sieve_primes and friends?
Eg.
use Math::Prime::XS;
print Math::Prime::XS::sieve_primes(13,13);
gets an error
Base is greater or equal number at x.pl line 2
where I hoped it would print 13, that being the sole prime between 13
and 13, inclusive.
In some of my code I've had a lo to hi where I want to find the primes,
but which might occasionally be just a single number range.
I can see disallowing lo>hi might keep the caller out of trouble with
args the wrong way around, but lo==hi could helpfully just return the
single number according to whether it's prime.