Subject: | factor and primes are limited to 2^32 |
Both factor and primes check that the inputs are 10 or fewer digits and less than 2^32. It is unclear to me whether this is:
1) intentional behavior that should always be maintained for compatibility.
or
2) sanity checking the range, and since 64-bit Perl didn't come until after these were written, 32-bit was hard coded.
These are not hard to extend, albeit they're not super speedy for larger numbers, but Ben Tilly wrote some pretty nice code so not nearly as bad as one might expect. I've been playing with alternate primes implementations -- it can be easily sped up 2x for large bases, and I'm sure more than that if we accept lots of turmoil.
For extra credit, we could even use Math::BigInt, but doing that for all inputs while maintaining decent speed might give too much bloat (at least for my coding it would).