[Rd] zapsmall (PR#7755)

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Mar 29 17:12:50 CEST 2005


On Tue, 29 Mar 2005 vosp at mail.ecu.edu wrote:

> Full_Name: Paul Vos
> Version: 2.0.1
> OS: windows XP
> Submission from: (NULL) (150.216.148.20)
>
>
>> zapsmall(.3-.2-.1,digits=7)
> [1] -2.775558e-17
>
> This should be zero.

Why `should' it?  The documentation says:

      'zapsmall' determines a 'digits' argument 'dr' for calling
      'round(x, digits = dr)' such that values "close to zero" (compared
      with the maximal absolute one) are "zapped", i.e., treated as '0'.

That value is not small compared with the maximal absolute one: it is 
equal to it.

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