Hi.
I've written a small program to compute very large numbers using the Collatz Conjecture. I have been told I should use the GMP library, so I downloaded the file, and there's a bunch of .c and .h files. So what I did was paste inside the folder my own .c file and use the headers gmp.h
However I am still unable to make use of large numbers such as 1000000000000000.
How can I fix this?
And if I successfully use the GMP library to work with large numbers, will they be absolutely precise?
Code:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "gmp.h"
int main(void){
unsigned long i,cont,iter;
cont=0;
for(i=1000000000000000;i<=1000000000000010;i++){
iter=i;
do{
if(iter%2==0){
iter/=2;
cont++;}
else{
iter=iter*3+1;
cont++;}
}while(iter!=1);
printf("Collatz Conjecture - iteration: %d\t\t\tsteps:%d\t\t\t\n",i,cont);
cont=0;}
return 0;
}