Re: [R] Modulus Problem

2004-12-09 Thread Robin Hankin
Hi On Dec 8, 2004, at 04:59 pm, McGehee, Robert wrote: R users, I am having a problem with the modulus operator for large numbers as follows, a <- 2 n <- 561 ## n is the first Carmichael number, so by Fermat's Little Theorem the below should equal zero. (a^(n-1) - 1) %% n [1] 2.193172e+152 I don't

Re: [R] Modulus Problem

2004-12-08 Thread Thomas Lumley
On Wed, 8 Dec 2004, McGehee, Robert wrote: R users, I am having a problem with the modulus operator for large numbers as follows, a <- 2 n <- 561 ## n is the first Carmichael number, so by Fermat's Little Theorem the below should equal zero. (a^(n-1) - 1) %% n [1] 2.193172e+152 ## Seems that R and

[R] Modulus Problem

2004-12-08 Thread McGehee, Robert
R users, I am having a problem with the modulus operator for large numbers as follows, a <- 2 n <- 561 ## n is the first Carmichael number, so by Fermat's Little Theorem the below should equal zero. (a^(n-1) - 1) %% n [1] 2.193172e+152 ## Seems that R and Fermat disagree ## Also, 100