[R] Strange sprintf Behavior

2014-04-02 Thread Michael Smith
All, I'm getting this: sprintf(%.17f, 0.8) [1] 0.80004 Where does the `4` at the end come from? Shouldn't it be zero at the end? Maybe I'm missing something. sessionInfo() R version 3.0.2 (2013-09-25) Platform: x86_64-redhat-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.utf8

Re: [R] Strange sprintf Behavior

2014-04-02 Thread Marc Schwartz
On Apr 2, 2014, at 6:32 AM, Michael Smith my.r.h...@gmail.com wrote: All, I'm getting this: sprintf(%.17f, 0.8) [1] 0.80004 Where does the `4` at the end come from? Shouldn't it be zero at the end? Maybe I'm missing something. Hi, First, please start a new thread when

Re: [R] Strange sprintf Behavior

2014-04-02 Thread Jeff Newmiller
It is poor netiquette to reply to a thread with a different subject. Please start a new thread for a new subject. As for your question, see FAQ 7.31. This is standard floating point numerical limitations at work. --- Jeff

Re: [R] Strange sprintf Behavior

2014-04-02 Thread Michael Smith
All, Apologies for the thread issue, and many thanks for the pointers to the FAQs. Thanks, M On 04/02/2014 10:14 PM, Jeff Newmiller wrote: It is poor netiquette to reply to a thread with a different subject. Please start a new thread for a new subject. As for your question, see FAQ 7.31.