Storing and printing integer values greater than 2^64

c, multiprecision, types

Solution

You can not do what you want with C natives types, however there are libraries that let handle arbitrarily large numbers, like the GNU Multiple Precision Arithmetic Library.

Problem

I am trying to write a program for finding Mersenne prime numbers. Using the unsigned long long type I was able to determine the value of the 9th Mersenne prime, which is (2^61)-1. For larger values I would need a data type that could store integer values greater than 2^64. I should be able to use operators like `*`, `*=`, `>` ,`<` and `%` with this data type.

Original source