Skip to content
Prev 153145 / 398500 Next

ignoring zeros or converting to NA

The help page on binary operators (see ?"==") confirms that binary
representation of fractional representation is not catered for and
points to all.equal as a more suitable test method for those cases.

Steve E
Integers (up to a fairly high limit) are represented exactly, as are
fractions whose denominator is a power of two (again up to a fairly high
limit), so x==0 is fine in that sense.

If x is computed by floating point operations you do have to worry
whether these are exact, eg, with
   x<-seq(-1,1,length=7)
it is not clear that the fourth element will be exactly zero.

     -thomas
On Wed, 13 Aug 2008, Roland Rau wrote:

            
equality of
right?)
numbers is
are zero?
perform
Is
only
similar to
http://www.R-project.org/posting-guide.html
Thomas Lumley			Assoc. Professor, Biostatistics
tlumley at u.washington.edu	University of Washington, Seattle

______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code.

*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}