Anonymous user
Miller–Rabin primality test: Difference between revisions
→{{header|Crystal}}
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
|||
Line 1,045:
private def miller_rabin_test(witnesses) # list of witnesses for testing
neg_one_mod = n = d = self - 1 # these are even as self is always odd
witnesses.each do |b| # do M-R test with each witness base
next if (b % self) == 0 # **skip base if a multiple of input**
|