Skip to content
Back to formatted view

Raw Message

Message-ID: <A72F821D-A274-4ACF-8F93-D535AD61E296@gmail.com>
Date: 2013-01-05T19:57:32Z
From: Peter Dalgaard
Subject: Rounding
In-Reply-To: <50E87F49.6020309@xtra.co.nz>

On Jan 5, 2013, at 20:30 , Rolf Turner wrote:

> On 01/06/2013 07:42 AM, David Arnold wrote:
>> Hi,
>> 
>> Can someone explain this:
>> 
>>> options(digits=20)
>>> 1/3
>> [1] 0.33333333333333331483
>> 
>> Why the 1483 at the end?
> 
> There are 10 sorts of people; those who understand binary
> arithmetic and those who don't.  See also FAQ 7.31.

Actually, it seems there are 11 sorts; those who understand binary, those who understand floating point binary, and those who do neither. The first 0.010101010101010101... of these would seem to the the issue here.

(Or 1.0101010101...e-10 if you want to split hairs.)

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com