0

After setting options(digits=22) in R, I noticed that when issuing 0.1*2 in the R console, I get 0.2000000000000000111022 as a result.

Any ideas why?

Regards.

David Arenburg
  • 91,361
  • 17
  • 137
  • 196
leco
  • 1,989
  • 16
  • 30
  • 1
    Probably [**R FAQ 7.31**](http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f) and [**this Q&A**](http://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal/9508558#9508558) are relevant here. – Henrik Oct 21 '14 at 09:43
  • 1
    Also , please read this one http://stackoverflow.com/questions/2769510/numeric-comparison-difficulty-in-r – PKumar Oct 21 '14 at 09:45

0 Answers0