Message-ID: <4B477988.1080908@gmail.com>
Date: 2010-01-08T18:29:28Z
From: Magnus Torfason
Subject: Newbie question on precision
In-Reply-To: <562308.8202.qm@web45813.mail.sp1.yahoo.com>
Paul Evans wrote:
> How can I get R to change the default precision value? For example:
>> x=0.99999999999999999
>> 1-x
> [1] 0
>
> Is there a way that I can get a non-zero value using some parameter, or some package?
> many thanks.
The 'gmp' package allows calculation with arbitrary precision rationals
(and every finite-digit decimal is a rational).
See a recent post of mine, listing some gmp examples:
http://tolstoy.newcastle.edu.au/R/e9/help/10/01/0579.html