[Rd] potential r bug (floor)

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jun 24 22:49:03 MEST 2003


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 at 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



More information about the R-devel mailing list