[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
http://en.wikipedia.org/wiki/The_Treachery_of_Images

And to watch
http://www.youtube.com/watch?v=ejweI0EQpX8

Hadley

-- 
Assistant Professor / Dobelman Family Junior Chair
Department of Statistics / Rice University
http://had.co.nz/



More information about the R-help mailing list