From ripley at stats.ox.ac.uk  Thu Jan 31 12:50:20 2008
From: ripley at stats.ox.ac.uk (ripley at stats.ox.ac.uk)
Date: Thu, 31 Jan 2008 12:50:20 +0100 (CET)
Subject: [Rd] logical operator and addition (PR#10665)
Message-ID: <20080131115020.A7FF5283462E@mail.pubhealth.ku.dk>

This seems another instance of FAQ Q7.31

> 0.6 - (0.4 + 0.2)
[1] -1.110223e-16


On Wed, 30 Jan 2008, nicolas_simonis at dfci.harvard.edu wrote:

> Full_Name: Nicolas Simonis
> Version: 2.6.1
> OS: windows
> Submission from: (NULL) (155.52.10.223)
>
>
> Very funny bug :

(rather a very common FAQ, when asked as a question)

>> 0.6<0.6
> [1] FALSE
>> 0.6<0.4+0.2
> [1] TRUE
>
> control :
>
>> 0.7<0.7
> [1] FALSE
>> 0.7<0.4+0.3
> [1] FALSE
>
> With R 2.6.1 windows. it's not doing it with R 2.3.1 linux...

It depends on the compiler and optimization settings: it is doing it on 
2.3.1 Linux for me (and 2.6.2 RC).

>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] logical operator and addition (PR#10665)
ripley at stats.ox.ac.uk