[R] Simple seq() boolean equality problem

2009-02-23 Thread Daniel G Polhamus

Hi all, thanks in advance for the help.

Can someone explain to me the following result, and what I'm doing wrong 
in the second case?


 seq(-43.7,-43.69,.001)[3]==-43.698
[1] TRUE
 seq(-43.7,-43.69,.001)[2]==-43.699
[1] FALSE
 seq(-43.7,-43.69,.001)[1]==-43.7
[1] TRUE

Dan

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Simple seq() boolean equality problem

2009-02-23 Thread Rolf Turner


On 24/02/2009, at 2:29 PM, Daniel G Polhamus wrote:


Hi all, thanks in advance for the help.

Can someone explain to me the following result, and what I'm doing  
wrong

in the second case?


seq(-43.7,-43.69,.001)[3]==-43.698

[1] TRUE

seq(-43.7,-43.69,.001)[2]==-43.699

[1] FALSE

seq(-43.7,-43.69,.001)[1]==-43.7

[1] TRUE


Floating point arithmetic.  FAQ 7.31.  RTFFAQ.

cheers,

Rolf Turner

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.