Re: [R] Modular inverses

2009-12-01 Thread Hans W Borchers
SJ Robson-Davis sr6827 at bristol.ac.uk writes: I want to find the inverse of an integer k mod p (prime.) Is there a function that can do this for me? I know i could simply write (k^(p-2)) %% p, but i need to do this for large primes (above 100) and this gives the warning message:

[R] Modular inverses

2009-11-27 Thread SJ Robson-Davis
I want to find the inverse of an integer k mod p (prime.) Is there a function that can do this for me? I know i could simply write (k^(p-2)) %% p, but i need to do this for large primes (above 100) and this gives the warning message: Warning message: probable complete loss of accuracy in modulus

Re: [R] Modular inverses

2009-11-27 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of SJ Robson-Davis Sent: Friday, November 27, 2009 8:52 AM To: r-help@r-project.org Subject: [R] Modular inverses I want to find the inverse of an integer k mod p (prime