From ripley at stats.ox.ac.uk  Tue Jun 24 22:49:03 2003
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue Jun 24 22:49:39 2003
Subject: [Rd] potential r bug (floor)
In-Reply-To: <3EF86DC0.5086.57E9D@localhost>
Message-ID: <Pine.LNX.4.44.0306242147580.26291-100000@gannet.stats>

On Tue, 24 Jun 2003, kjetil brinchmann halvorsen wrote:

> On 23 Jun 2003 at 20:20, Prof Brian D Ripley wrote:
> 
> > Why is this a bug?  If you take apply floor to a number that you expect to
> > be exactly 3, but compute it on a binary computer via logs to base e, you
> > must expect some rounding error.
> > 
> > BTW, on my Windows XP machine I do get
> > 
> > > floor(log10(1000))
> > [1] 3
> > 
>  
> On my windows XP machine (R1.7.1) i get:
> 
> > floor( log10(1000) )
> [1] 2
> 
> 
> Why this difference between different XP machines?

Different DLLs, no doubt.  Possibly also different chips.

The real question is why *you* expected them to be the same?

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] potential r bug (floor)
Prof Brian Ripley