2
((10*(7655.7-7652.3))%/%(2))
[1] 16

((10*(655.7-652.3))%/%(2))
[1] 17

((10*(7655.7-7652.3))%/%(2))
[1] 16

((10*(8655.7-8652.3))%/%(2))
[1] 17

((10*(9655.7-9652.3))%/%(2))
[1] 17

((10*(7655.7-7652.3))%/%(2))
[1] 16

%/% operator gives the quotient so why is the result different when we replace the 9 in 9652.3 with 7 ?

jbaums
  • 27,115
  • 5
  • 79
  • 119
Mayank Raj
  • 121
  • 2
  • 12
  • there's an explanation there : http://stackoverflow.com/questions/9508518/why-are-these-numbers-not-equal – Cath Nov 19 '14 at 08:58
  • It is not a problem of modulus. If you type `(7655.7-7652.3)-(655.7-652.3)`, you get `-4.547474e-13` not 0. I think it is due to how R "stores" those numbers. – Cath Nov 19 '14 at 09:02

0 Answers0