Miller–Rabin primality test: Difference between revisions

(Added zkl)
Line 2,493:
END FUNCTION</lang>
 
=={{header|Scala}}==
[[Category:Scala Implementations]]
{{libheader|Scala}}<lang scala>import scala.math.BigInt
 
object MillerRabinPrimalityTest extends App {
val (n, certainty )= (BigInt(args(0)), args(1).toInt)
println(s"$n is ${if (n.isProbablePrime(certainty)) "probably prime" else "composite"}")
}</lang>
=={{header|Seed7}}==
<lang seed7>$ include "seed7_05.s7i";
Line 2,539 ⟶ 2,547:
end if;
end for;
end func;</lang>Original source: [http://seed7.sourceforge.net/algorith/math.htm#millerRabin]
end func;</lang>
 
Original source: [http://seed7.sourceforge.net/algorith/math.htm#millerRabin]
 
=={{header|Smalltalk}}==
Anonymous user