0

Im new to R programming, I typed the following and I assumed both should return TRUE, but the first one doesn't, any ideas?

identical(0.3-0.1,0.5-0.3);
identical(0.2,0.2);

[1] FALSE
[1] TRUE
Vinícius Félix
  • 4,501
  • 3
  • 12
  • 28
Mastha
  • 1
  • 1
    Floating point comparisons are not accurate. Read https://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal – Ronak Shah Oct 04 '21 at 03:20

0 Answers0