From rbugs09 at kreil.org  Fri Jun 19 13:35:11 2009
From: rbugs09 at kreil.org (rbugs09 at kreil.org)
Date: Fri, 19 Jun 2009 13:35:11 +0200 (CEST)
Subject: [Rd] Floating point precision / guard digits? (PR#13771)
Message-ID: <20090619113511.336752832009@mail.pubhealth.ku.dk>

Full_Name: D Kreil
Version: 2.8.1 and 2.9.0
OS: Debian Linux
Submission from: (NULL) (141.244.140.179)


Group: Accuracy

I understand that most floating point numbers are approximated due to their
binary storage. On the other hand, I thought that modern math CPUs used guard
digits to protect against trivial underflows. Not true?

# integers, no problem
> 1+1+1==3
[1] TRUE
# binary floating point approximation underflows
> .1+.1+.1==.3
[1] FALSE
> .1+.1+.1==.3
[1] FALSE
# binary floating point exact for certain numbers
> .1+.1==.2
[1] TRUE

I know that safe code should not test for quality of floats. Still, is R
underutilizing the power of the underlying hardware?

Grateful for comments,
David.



[Rd] Floating point precision / guard digits? (PR#13771)
rbugs09 at kreil.org