You can get the 'bc' package for R, or just use 'bc' itself:
Copyright 1991, 1992, 1993, 1994, 1997, 1998 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
On Tue, Jul 27, 2010 at 6:34 PM, vincent.deluard
<[hidden email]> wrote:
> As far as I can tell, the largest number R can take has 308 digits
This is not a correct statement. The magnitude of the largest 64-bit double
point number in R is approximately 1E308. The internal storage in R (and
in most computers today)
contains only the first 53 binary digits of the number multiplied by a power
of 2. Please see R FAQ 7.31
and the Goldberg article referenced there.
The bc results Jim suggested will get you the several hundred digits of the
full precision number,
but that is not what R sees.
The best way to see the exact number internally stored in R is the sprintf
> Hi all,
> I am dealing with very large numbers but I am only interested in their last
>  Inf
> As far as I can tell, the largest number R can take has 308 digits (1+E308).
> Is there a way I could see the last digits only of 244^244?
> Many thanks for your help.
> Vincent Deluard, CFA.
Use the facts that the last digits of X are equal to X modulo 10^n, for
some n, and that X*Y modulo Z = (X modulo Z) * (Y modulo Z) modulo Z.
Then you can calculate it easily in base R, as long as n is no more than
7 (so that the individual multiplications don't overflow). For example,
> result <- 1
> for ( i in 1:244)
+ result <- (result * 244) %% 1000