I know that running a simple line such as sqrt(2) ^ 2 == 2
will return FALSE, but when I create an object with the left part of the equation, it returns the value 2, but when logically comparing the object to the number 2, I still get FALSE. This seems to be in error. Here is the code:
> (root.of.2 <- sqrt(2))
[1] 1.414214
> (root.of.2.sqrd <- sqrt(2) ^ 2)
[1] 2
> (root.of.2.sqrd == 2)
[1] FALSE
What’s going on here?