From ligges at statistik.uni-dortmund.de  Wed May 23 11:33:42 2007
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Wed, 23 May 2007 11:33:42 +0200
Subject: [Rd] R 2.5.0 refuses to print enough digits to recover exact
 floating point values
In-Reply-To: <eb97335b0705220849l624d8cai6e49e37e2565ab81@mail.gmail.com>
References: <eb97335b0705220013m6f3e137cp147d429c46717e24@mail.gmail.com>	
	<4652C19F.1040509@statistik.uni-dortmund.de>
	<eb97335b0705220849l624d8cai6e49e37e2565ab81@mail.gmail.com>
Message-ID: <46540A76.2080909@statistik.uni-dortmund.de>



Zack Weinberg wrote:
> On 5/22/07, Uwe Ligges <ligges at 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



[Rd] R 2.5.0 refuses to print enough digits to recover exact floating point values
Uwe Ligges