When I try the following in R, it returns 4
(i = 3.999999999)
#> [1] 4
Created on 2020-09-02 by the reprex package (v0.3.0)
I was expecting it to return 3.999999999
. Can someone explain why is it happening, is it due to floating point error?
Also, in the RStudio IDE, the variable is shown to have value 3.999999999
, but 4 on the console.