Follow

Wat.

> x <- sqrt(2) ^ 2
> x
[1] 2
> x == 2
[1] FALSE
> x - 2
[1] 4.440892e-16

I recognize that floating point error is an issue, but printing a float as its approximate integer value seems ... perilous.

(Example from Wickham & Grolemund, R for Data Science.)

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.