From ripley at stats.ox.ac.uk  Tue Mar 29 17:12:50 2005
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue Mar 29 17:13:08 2005
Subject: [Rd] zapsmall (PR#7755)
In-Reply-To: <20050329145207.3E123C6F9@slim.kubism.ku.dk>
References: <20050329145207.3E123C6F9@slim.kubism.ku.dk>
Message-ID: <Pine.LNX.4.61.0503291557530.21319@gannet.stats>

On Tue, 29 Mar 2005 vosp@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@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] zapsmall (PR#7755)
Prof Brian Ripley