Exactly 64 bits
maqableh_cs at yahoo.com
Sun Mar 7 00:49:54 CET 2010
I wrote program that calculate the nth value of x after iteration the logistic map using GMP on windows vista as operating system. Also, I am doing circle left shift with 11 bits on the final value. I would like to have all the values to be 64-bit exactly. Unfortunately, I found this process is not accurate and it sometimes give numbers bigger than the 64-bit.
Could anyone help me to have always 64-bit stored in each variable bafore and afer any operation?
for (x=1; x<=35; x++)
gmp_printf( "\n The Value of Xn after 35 Iteration = %.Ff \n", x0);
mpf_mul_2exp(xn, x0, 64); //convert the value to Integer (64 bits) x0* 2^64
mpz_set_f(x1, xn); // Asign the value to the variable x1 as 64-bit integer
mpz_mul_2exp(x1, x1, 11); // circlue left shift with 11 bits
Thanks very much in advance.
More information about the gmp-discuss