Re: [R] precision problem

From: Roger Bivand <Roger.Bivand_at_nhh.no>
Date: Thu 26 May 2005 - 00:21:34 EST


On Wed, 25 May 2005, Omar Lakkis wrote:

?all.equal, I think

> I have prices that I am finding difficult to compare with ==, > and >,
> due to precision. For example: the numbers should match, with '==',
> but they differ in the magnitude of 1e-14 due to bunch of calculations
> that I run on them. Programming with java, I am used to implementing a
> function that compares the difference between the numbers to a pre
> determined precision factor. This could be very slow when I have two
> matrices of numbers that I could otherwise compare with a simple '==',
> '>' or '<' in R.
> What is teh best solution for this problem?
> Can I control the precision of ==, > and < without having to
> reimplement the operations in a slow way?
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand@nhh.no

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Thu May 26 00:40:22 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:05 EST