im fairly new to Multiple Precision Arithmetic, and after a few days of trying to figure this out im at a loss. im trying to take the inverse of a number to a high number of deciaml places and have been attempting to work out how to do this using GMP or the mpz/mpf package. however i am a little lost with understanding the example from this link:
/* to compute the inverse of op1 modulo op2 and put result in rop */
/* p*x = s*n + 1 ( rop = p, op1 = x, op2 = n ) */
/* */
n = mpz_invert ( rop, op1, op2 );
I have duplicated this example in my ide complied and run and im getting the correct output:
/* rop = 2288 */
/* n = 1
However i dont understand what 2288 is? i.e. compute the inverse of op1 modulo op2 and put result in rop
could anyone explain how this number is obtained?
or a simple example to say taking:
1875 ^ -6
or w.r.t the following link: How does one calculate 2 ^ -18 using GMP?
taking:
1 / (1875 ^ 6)
Any help would be much appreciated!