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

Greg Snow Greg.Snow at imail.org
Tue Feb 12 18:44:10 CET 2008

I don't think that we need a full discussion in the Introduction, but
how about early on it shows an example of 2 floating point numbers not
being equal (and one of the work arounds like all.equal) along with a
note (bright, bold, etc.) that says that if the reader did not expect
the FALSE result then they should read FAQ 7.31 (and maybe even include
a link they can click on right then).

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
(801) 408-8111

> -----Original Message-----
> From: r-devel-bounces at r-project.org 
> [mailto:r-devel-bounces at r-project.org] On Behalf Of 
> Ted.Harding at manchester.ac.uk
> Sent: Tuesday, February 12, 2008 8:32 AM
> To: r-devel at stat.math.ethz.ch
> Subject: Re: [Rd] 0.45<0.45 = TRUE (PR#10744)
> On 12-Feb-08 14:53:19, Gavin Simpson wrote:
> > On Tue, 2008-02-12 at 15:35 +0100, labonne at st-pee.inra.fr wrote:
> >> Dear developer,
> >> 
> >> in my version of R (2.4.0) as weel as in a more recent version
> >> (2.6.0) on different computers, we found this problem :
> > 
> > No problem in R. This is the FAQ of all FAQs (Type III SS 
> is probably 
> > up there as well).
> 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 would not occur to them, spontaneously, that the computer 
> is doing the right thing and that they should look in a FAQ 
> for an explanation of how they do not understand!
> I would be willing to contribute to such an explanation; and 
> probably many others would too. But I feel it should be 
> coordinated by people who are experts in the internals of how 
> R handles such things.
> Best wishes to all,
> Ted.
> --------------------------------------------------------------------
> E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
> Fax-to-email: +44 (0)870 094 0861
> Date: 12-Feb-08                                       Time: 15:31:26
> ------------------------------ XFMail ------------------------------
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list