Possible Duplicate:
Checking if an int is prime more efficiently
I need to test some very large integer to see whether it is a prime. Could you provide some good algorithms or library routines?
EDIT: C/C++ would be OK.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The Miller-Rabin test is very fast, and it can be both fast and deterministic for certain ranges of numbers.