I need to work out if a massive integer (I mean 20 digits…) is prime.
I’m trying to use the brute-force method, but (of course) I need to use doubles to contain the original number. However, the modulo operator (%) is an integer operator – thus it is useless to me!
That’s not possible, a double only has 15 significant digits. Look for an implementation of a BigInt class. C specific is discussed here.