• Did you notice anything weird while finishing the Choice Operations exercise?
  • Take a closer look at item 4.

Floating point

> x <- 1.3
> y <- 2.8
>  x * 2 + 0.2 == y
[1] FALSE
> 1.3 * 2 + 0.2
[1] 2.8
>>> 1.3 * 2 + 0.2 == 2.8
False
>>> 1.3 * 2 + 0.2
2.8000000000000003

Testing equality with decimals