Skip to content
Prev 174310 / 398506 Next

numeric equality

On Wed, 2009-03-18 at 11:58 -0400, Yu, Changhong wrote:
Hi Yu,

First of all read FAQ 7.31 (Why doesn't R think these numbers are
equal?)

Second, in this case, use all.equal

a <- 1 - 0.8

a == 0.2
[1] FALSE

all.equal(a,0.2)
[1] TRUE