Jump to content

Talk:Miller–Rabin primality test: Difference between revisions

no edit summary
No edit summary
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 ==
 
Cookies help us deliver our services. By using our services, you agree to our use of cookies.