Dan0042 (Daniel DeLorme) wrote in #note-15: > I think it would be interesting to expose the algorithm for larger numbers. So you could have `miller_rabin` which allows any integer, and `prime?` which checks the value and either call `mi...steveb3210 (Stephen Blackstone)
On second thought, I think Marc is right, we can't ruin someones day with a composite without a warning that theres a non-zero probability of it being incorrect so I will update......steveb3210 (Stephen Blackstone)
marcandre (Marc-Andre Lafortune) wrote: > Interesting. We might as well always return the correct result, i.e. apply the fast algorithm for integers < 318,665,857,834,031,151,167,461 and the slow algorithm for larger ones. Would you car...steveb3210 (Stephen Blackstone)
The miller-rabin algorithm is a non-deterministic primality test, however it is known that below 2**64, you can always get a deterministic answer by only checking a=[2,3,5,7,11,13,17,19,23, 29, 31, 37] Given that Prime.prime? would ne...steveb3210 (Stephen Blackstone)