Talk:Miller–Rabin primality test: Difference between revisions

Content added Content deleted
No edit summary
Line 1: Line 1:
== C# ==

The code for method RabinMiller.IsPrime(int n, int k) returns incorrect results. For example, RabinMiller.IsPrime(181, 10) returns false even though 181 is prime. I believe the incorrect value is returned because the line

<lang C#>
int mod = (int)Math.Pow(a, (double)temp) % n;
</lang>

overflows.

== Python ==
== Python ==