I want to use large integer to do some computation similar to the following:
#include<stdio.h>
int main (){
long a = 123456789123456789123456789123456789;
long b = 2*b;
printf("%ld", a);
printf("\n");
printf("%ld",b );
return 0;
}
which currently generates:
main.c:4:12: error: integer literal is too large to be represented in any integer
type
long a = 123456789123456789123456789123456789;
^
1 error generated.
I know there is a library called libtomath as pointed by this other SO question but I could not find any example and and I'm new to C and don't know how to read through a library to find the answer. How could I modify the code using libtomath (or other solutions)?