[R] Extending the accuracy of exp(1) in R

Hadley Wickham hadley at rice.edu
Tue Nov 9 14:57:08 CET 2010

> Where the value of exp(1) as computed by R is concerned, you have
> been deceived by what R displays ("prints") on screen. The default
> is to display any number to 7 digits of accuracy, but that is not
> the accuracy of the number held internally by R:
>  exp(1)
>  # [1] 2.718282
>  exp(1) - 2.718282
>  # [1] -1.715410e-07

I encourage anyone confused about this issue to study

And to watch


Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University

More information about the R-help mailing list