Try this code:
R version 3.4.4 (2018-03-15) -- "Someone to Lean On"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
[...]
> round(55.8/1.8)
[1] 31
> 55.8/1.8
[1] 31
> round(55.8/1.8) == (55.8/1.8)
[1] FALSE
> round(55.8/1.8) - (55.8/1.8)
[1] 3.552714e-15
How is it possible? Is it a bug? I found it after verifying some data in a dataset where I was looking for records where the division between two numbers was not integer, by checking if the round
value was equal to the result of /
operator.