Re: [Rd] simple add error (PR#13699)

2009-05-13 Thread Petr Savicky
On Wed, May 13, 2009 at 02:35:12PM +0200, gos...@igmm.cnrs.fr wrote: > I cannot explain why R seems to have problems adding two big numbers. > > sprintf("%f",10^4+10^19) gives "10010240.00" > instead of "1001.00" > > problems seems to arriv

[Rd] simple add error (PR#13699)

2009-05-13 Thread gostan
Full_Name: Gostan Thierry Version: 2.6.1 (2007-11-26) OS: Windows XP Submission from: (NULL) (193.49.190.42) I cannot explain why R seems to have problems adding two big numbers. sprintf("%f",10^4+10^19) gives "10010240.00" instead of "1001.00

Re: [Rd] simple add error (PR#13699)

2009-05-13 Thread Ben Bolker
gostan wrote: > > Full_Name: Gostan Thierry > Version: 2.6.1 (2007-11-26) > OS: Windows XP > Submission from: (NULL) (193.49.190.42) > > I cannot explain why R seems to have problems adding two big numbers. > > sprintf("%f",10^4+10^19) gives "10010240.00" >

Re: [Rd] simple add error (PR#13699)

2009-05-13 Thread Joshua Ulrich
Gostan, This is not a bug. You're asking for 20 decimal digits of precision, which is impossible with double-precision floating point arithmetic. http://fr.wikipedia.org/wiki/Virgule_flottante Best, Josh -- http://www.fosstrading.com On Wed, May 13, 2009 at 7:35 AM, wrote: > Full_Name: Gos