There are no (finite) numbers beyond the range of integer. Do you mean the int type? If so you may be able to extend the range by using long instead of int. Check your compiler documentation for how large the different integer types are; the standard only mandates that short <= int <= long, so all integer types could be 32-bit.

If no built in types fit the range you want to test then you'll have to define your own type and encode the operations you want to use. This isn't as difficult as it sounds; there's already an example of how we normally do that in this reply, i.e. the number 32 - no single digit has a value greater than 9, so we use multiple digits to represent numbers larger than 9. So you can use multiple ints to represent numbers larger than 2^(8*sizeof int), for example int bignum[4] will represent a number up to 2^(4*8*sizeof int).

Then you will need to write code to add these, because the built in operators only know about built in types. Again this is fairly easy; just remember how you did it on paper then write code to do that, for example:

1234

5678+

====

4+8=12, so write 2 below 4 and 8 and carry the 1. 3+7=10, add the carry=11, write 1, carry 1.

2+6=8, add carry=9, write 9. 1+5=6.

So in code you might have something like (simplified):

Code:

int bignum1[4]={1,2,3,4};
int bignum2[4]={5,6,7,8};
int bugnum3[4]={0,0,0,0}; // this will contain the sum
int carry=0;
for (int i=3; i>=0; i--) {
bignum3[i]=bignum1[i]+bignum2[i]+carry;
carry=0;
if (bignum3[i]>10) {
bignum3[i]-=10;
carry=1;
}
}