From ripley at stats.ox.ac.uk  Fri Dec  6 08:45:30 2013
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri, 06 Dec 2013 07:45:30 +0000
Subject: [Rd] bug in default print method / floating point problem?
In-Reply-To: <CAGxaO+Bt9DY-akWgzdGoMwFLq+ULVJiwxHnU98=X7buYAa4uNA@mail.gmail.com>
References: <CAGxaO+Bt9DY-akWgzdGoMwFLq+ULVJiwxHnU98=X7buYAa4uNA@mail.gmail.com>
Message-ID: <52A1809A.3070907@stats.ox.ac.uk>

On 05/12/2013 21:50, Pablo Barber? wrote:
> In R 3.0.2, I found this weird behavior:
>
>> 7/0.07
> [1]100
>> 6/0.06
> [1] 100
>
> There's one space missing between the bracket and the 100 in the first
> case. I don't know if this is a known bug or not. It might have
> something to do with precision of floating point numbers:
>
>> options(digits=22)
>> 7/0.07
> [1] 99.99999999999998578915
>
> Maybe R doesn't add the extra space when it rounds the number for
> display? This is probably an irrelevant issue, but I thought I would
> report it just in case.
>
> Pablo Barbera

Sees to be the same as the recent bug report PR#15583, which is under 
investigation.

R always used to round before computing the width, but someone 
'optimized' it recently: 3.0.1 did not do this.

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



[Rd] bug in default print method / floating point problem?
Prof Brian Ripley