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
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.