On Jul 3, 2014, at 1:28 PM, Matthew Keller <mckellerc...@gmail.com> wrote:

> Hi all,
> 
> A bit stumped here.
> 
> z <- seq(.05,.85,by=.1)
> z==.05     #good
> [1]  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> 
> z==.15  #huh????
> [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> 
> More generally:
>> sum(z==.25)
> [1] 1
>> sum(z==.35)
> [1] 0
>> sum(z==.45)
> [1] 1
>> sum(z==.55)
> [1] 1
>> sum(z==.65)
> [1] 0
>> sum(z==.75)
> [1] 0
>> sum(z==.85)
> [1] 1
> 
> Does anyone have any ideas what is going on here?


See the MFAQ[1]:

  
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f

Regards,

Marc Schwartz

[1] Most Frequently Asked Question

______________________________________________
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.

Reply via email to