[Rd] 0.45<0.45 = TRUE (PR#10744)
hadley wickham
h.wickham at gmail.com
Tue Feb 12 19:25:33 CET 2008
> I'm thinking (by now quite strongly) that there is a place
> in "Introduction to R" (and maybe other basic documentation)
> for an account of arithmetic precision in R (and in digital
> computation generally).
>
> A section "Arithmetic Precision in R" near the beginning
> would alert people to this issue (there is nothing about it in
> "Introduction to R", "R Language Definition", or "R internals").
>
> Once upon a time, poeple who did arithmetic knew about this
> from hands-on experience (just when do you break out of the
> loop when you are dividing 1 by 3 on a sheet of paper?) -- but
> now people press buttons on black boxes, and when they find
> that 1/3 calculated in two "mathematically equivalent" ways
> comes out with two different values, they believe that there
> is a bug in the software.
It's more than that as though, as floating point addition is no longer
guaranteed to be commutative or associative, and multiplication does
not distribute over addition. Many concepts that are clear cut in
pure math become fuzzy in floating point math - equality, singularity
of matrices etc etc.
Hadley
--
http://had.co.nz/
More information about the R-devel
mailing list