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

Duncan Murdoch murdoch at stats.uwo.ca
Thu Jan 31 12:39:43 CET 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 :
>
>   
>> 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
>



More information about the R-devel mailing list