From murdoch at stats.uwo.ca  Thu Jan 31 12:39:43 2008
From: murdoch at stats.uwo.ca (Duncan Murdoch)
Date: Thu, 31 Jan 2008 06:39:43 -0500
Subject: [Rd] logical operator and addition (PR#10665)
In-Reply-To: <20080130175512.6ED782834170@mail.pubhealth.ku.dk>
References: <20080130175512.6ED782834170@mail.pubhealth.ku.dk>
Message-ID: <47A1B37F.50400@stats.uwo.ca>

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 :
>
>   
>> 0.6<0.6
>>     
> [1] FALSE
>   
>> 0.6<0.4+0.2
>>     
> [1] TRUE
>
>   
I don't see a bug here, I see failure to read FAQ 7.31.  The value 0.6 
is less than 0.4+0.2, when the operation is done in floating point 
approximations.  None of those three numbers is exactly representable.

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

Duncan Murdoch
> 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...
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] logical operator and addition (PR#10665)
Duncan Murdoch