Hi. Check R FAQ, section 7.31 Why doesn't R think these numbers are equal? http://cran.r-project.org/doc/FAQ/R-FAQ.html
all.equal(a,b) Andrija On Mon, May 20, 2013 at 2:36 PM, Jannis <bt_jan...@yahoo.de> wrote: > Dear R users, > > > > I ran into the strange situation where a number does not seem to equal its > value. Try this: > > > > a <- seq(0.05,0.7,0.05)[3] > > b <- 0.15 > > a == b > > > Should this not be TRUE? a-b yields a very small number (and not 0) so > this most probably is a numerical error, but why does seq create such > numbers? > > > Thanks a lot > Jannis > > ______________________________**________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do read the posting guide http://www.R-project.org/** > posting-guide.html <http://www.R-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ 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.