[R] Simple addition and subtraction doesn't work??

Adrian Teo ateo at whitworth.edu
Fri Oct 3 21:22:26 CEST 2008


I was working on a teaching example, but came across this weird result:

> q<-c(1.6,2.6, -3.4)
> q
[1]  1.6  2.6 -3.4
> sum(q)
[1] 0.8
> sum(q)- 0.8
[1] 2.22044605e-16

Why is the result not precisely zero?

Thanks!

AT



More information about the R-help mailing list