Skip to content
Prev 58889 / 398502 Next

wrong answer for simple expressions

R does double precision arithmetic and accumulates roundoff error 
like any other double precision computations.  I would therefore expect 
it to accumulate roundoff error as you have reported.  In most cases 
like you mentioned, a difference of 4e-16 is "not material", to use 
Accounting jargon.  If it is an issue, you either need to do error 
analysis or use something like Mathematica that does infinite precision 
arithmetic. 

      hope this helps.  spencer graves
Drew Hoysak wrote: