From savicky at cs.cas.cz  Mon Aug  3 11:50:01 2009
From: savicky at cs.cas.cz (Petr Savicky)
Date: Mon, 3 Aug 2009 11:50:01 +0200
Subject: [Rd] incorrect result (41/10-1/10)%%1 (PR#13863)
In-Reply-To: <20090801200513.EC2A8282EF3D@mail.pubhealth.ku.dk>
References: <20090801200513.EC2A8282EF3D@mail.pubhealth.ku.dk>
Message-ID: <20090803095001.GA22251@cs.cas.cz>

> I get an incorrect result for
> 
> (41/10-1/10)%%1
> 
> [1] 1

Note that due to rounding errors, 41/10-1/10 is
  formatC(41/10-1/10, digits=20) # [1] "3.9999999999999995559"

Besides FAQ 7.31, related information may be found also at
  http://wiki.r-project.org/rwiki/doku.php?id=misc:r_accuracy

Petr.



[Rd] incorrect result (41/10-1/10)%%1 (PR#13863)
Petr Savicky