Representation of floating point numbers (PR#1281)
On Thu, 24 Jan 2002 theis@statistik.uni-dortmund.de wrote:
On 24-Jan-02 Prof Brian Ripley wrote:
There is a function all.equal provided for this purpose: it is a misuse of ==.
But there is no hint or note on the "Comparisons" help page concerning this problem. If it is a misuse one should be warned against it.
But there is a warning there: Don't use == and != for tests, such as in if expressions, where you must get a single TRUE or FALSE. Unless you are absolutely sure that nothing unusual can happen, you should use the identical function instead. And 'identical' suggests:
identical(all.equal(x, y), TRUE)
Clever indeed!
Göran Broström tel: +46 90 786 5223 professor fax: +46 90 786 6614 Department of Statistics http://www.stat.umu.se/egna/gb/ Umeå University SE-90187 Umeå, Sweden e-mail: gb@stat.umu.se -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._