Alexander Nervedi wrote: > > I am trying to figure out what is going on here. > >> a <- 68.08 >> b <- a-1.55 >> a-b > [1] 1.55 >> a-b == 1.55 > [1] FALSE >> round(a-b,2) == 1.55 > [1] TRUE >> round(a-b,15) == 1.55 > [1] FALSE > > Why should (a - b) == 1.55 fail when in fact b has been defined to be a - > 1.55? Is this a precision issue? How do i correct this? >
Read th R FAQ. See 7.31 Why doesn't R think these numbers are equal? Berend -- View this message in context: http://n4.nabble.com/precision-issue-tp1577815p1577903.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.