Re: [Rd] R 2.5.0 refuses to print enough digits to recover exact floating point values

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Wed, 23 May 2007 11:33:42 +0200

Zack Weinberg wrote:
> On 5/22/07, Uwe Ligges <ligges@statistik.uni-dortmund.de> wrote:

>> Zack Weinberg wrote:
>> >
>> > I'd really appreciate some way of forcing R to print enough digits to
>> > represent every possible IEEE double value.  I would also argue that
>> > this should be the default behavior of dump(), write.table() and
>> > friends, and save(...,ascii=TRUE), to prevent data loss.
>>
>> Example:
>>
>> formatC(exp(1), digits=100, width=-1)

>
> Well, okay, now what about dump, write.table, save, etc?

save() uses the required precision. For exp(1) it stores "2.718281828459045" and you will see that

exp(1) == 2.718281828459045 is TRUE

Uwe Ligges

> zw



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed 23 May 2007 - 09:38:41 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 May 2007 - 17:33:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.