launchcode
January 22nd, 2009, 05:41 PM
Hi,
Can anyone help me use GMP for addition in C?
I'm relatively new to C but have a fair understanding and have written several algorithms. I now need to use GMP, and would be grateful if anyone could show me how to code the following routine:
Declare (initialize) a, b, c as mp floats to 256 bits of precision.
Set a = 1E-20, b = 1E-21.
Calculate c = a + b
printf ("%f", c);
Note, I've already installed GMP successfully and know how to link it into the compilation using gcc.
Thanks!
Can anyone help me use GMP for addition in C?
I'm relatively new to C but have a fair understanding and have written several algorithms. I now need to use GMP, and would be grateful if anyone could show me how to code the following routine:
Declare (initialize) a, b, c as mp floats to 256 bits of precision.
Set a = 1E-20, b = 1E-21.
Calculate c = a + b
printf ("%f", c);
Note, I've already installed GMP successfully and know how to link it into the compilation using gcc.
Thanks!