From h.wickham at gmail.com  Tue Feb 12 19:25:33 2008
From: h.wickham at gmail.com (hadley wickham)
Date: Tue, 12 Feb 2008 12:25:33 -0600
Subject: [Rd] 0.45<0.45 = TRUE (PR#10744)
In-Reply-To: <XFMail.080212153130.Ted.Harding@manchester.ac.uk>
References: <1202827999.2701.19.camel@prometheus.geog.ucl.ac.uk>
	<XFMail.080212153130.Ted.Harding@manchester.ac.uk>
Message-ID: <f8e6ff050802121025w717ef902q7d186d0e1664845f@mail.gmail.com>

> 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/



[Rd] 0.45<0.45 = TRUE (PR#10744)
hadley wickham