128 bit Miller Rabin Primality test

954 views Asked by At

I wanted to implement Miller Rabin Primality Test for large numbers. I wanted to know how to deal with such huge numbers in C++. Should I write any special function to store and process those large numbers or care is taken automatically?

1

There are 1 answers

0
Kerrek SB On

You should use an arbitrary precision library. Since you only need integers, GMP is a very popular and well-maintained such library. It has a nice C++ interface provided by <gmpxx.h>.