[R] precision in seq

Peter Dalgaard P.Dalgaard at biostat.ku.dk
Tue Feb 5 12:08:33 CET 2008


Barry Rowlingson wrote:
> Prof Brian Ripley wrote:
>   
>> FAQ Q7.31 and ?"==" should enlighten you.
>>
>> None of 0.05, 0.1 ... 0.9, 0.95 are exactly representable on a binary 
>> computer.
>>     
>
>   Doesn't the string "0.95" constitute an exact representation? And my 
> computer is definitely binary. Although I suspect it is also bipolar.
>   
Will you stop pulling Brian's l...., ah, well, then again, never mind...

"Representable as binary floating point numbers" is correct, never mind
on which computer. (Binary computers can and do also do BCD arithmetic
(binary coded decimal) for bookkeeping applications, specifically to
avoid cumulating roundoff. At least some have harware support for it.
Similarly, nothing is keeping a decimal computer from doing binary
arithmetic.)

And actually, three of those numbers *are* representable in binary
floating point. ;-)

>   It's the lack of understanding of the underlying encoding of real 
> numbers - or even the actual *existence* of the underlying encoding - 
> that means the cry of 'FAQ Q7.31!' will long echo down the halls of R-help.
>   


-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list