Skip to content
Back to formatted view

Raw Message

Message-ID: <BF1E10A3.BFF5%sdavis2@mail.nih.gov>
Date: 2005-08-09T11:49:55Z
From: Sean Davis
Subject: floor() rounding problem?
In-Reply-To: <42F89698.3090809@bristol.ac.uk>

On 8/9/05 7:42 AM, "Simon Woodhead" <simon.woodhead at bristol.ac.uk> wrote:

> Dear all,
> 
> Could someone please explain the following perculiarity?
> 
>> 2 == 0.2/0.1
> [1] TRUE
>> 3 == 0.3/0.1
> [1] FALSE
> 
> Similarly,
> 
> floor(0.2/0.1) = 2
> floor(0.3/0.1) = 2


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

Hope this helps.
Sean