[R] Precision level

Rolf Turner r.turner at auckland.ac.nz
Fri Mar 26 01:34:05 CET 2010


On 26/03/2010, at 12:38 PM, jim holtman wrote:

> WHen using '==' or '%in%' it is a equality test -- it has to equal zero.  If
> you want a tolerance in the test, use 'all.equal'
> 
> On Thu, Mar 25, 2010 at 5:29 PM, Dimitri Liakhovitski <ld7631 at gmail.com>wrote:
> 
>> Hello!
>> 
>> I am wondering at what point does R consider a numeric value to be
>> equal to zero - for statements of the type x==0 and x %in% 0.
>> 
>> Thank you very much!


There is still perhaps a question to be answered here.  One can key in
a representation of a number, different from ``0'' and yet get a value
deemed to be 0 by the machine.

E.g. on my machine
> 1e-324 == 0
[1] TRUE
> 1e-323 == 0
[1] FALSE

The question of where the line is drawn is probably ill-posed or meaningless
or something like that.  It's not clear to me what the issues are.  Also the
answer, if there is a meaningful one, is likely to be machine dependent rather
than R dependent.

	cheers,

		Rolf Turner

######################################################################
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.

This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com
######################################################################



More information about the R-help mailing list