Re: [R] Difference

From: Dimitris Rizopoulos <dimitris.rizopoulos_at_med.kuleuven.ac.be>
Date: Tue 19 Apr 2005 - 18:41:23 EST

Look at "?Comparison", especially in the "Note" section:

...

For numerical values, remember == and != do not allow for the finite representation of fractions, nor for rounding error. Using all.equal with identical is almost always preferable. See the examples.

...

Best,
Dimitris



Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium

Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.ac.be/biostat/
     http://www.student.kuleuven.ac.be/~m0390867/dimitris.htm



> Dear List,
> can anyone explain me this result (Windows XP, R 2.0.1):
>
> > (0.2-0.1)==0.1
> [1] TRUE
> > (0.3-0.2)==0.1
> [1] FALSE
>
> Regards,
> Ralf Strobl
>
> ______________________________________________
> 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
>



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 Tue Apr 19 18:48:18 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:16 EST