From theis@statistik.uni-dortmund.de  Thu Jan 24 15:15:58 2002
From: theis@statistik.uni-dortmund.de (Winfried Theis)
Date: Thu, 24 Jan 2002 15:15:58 -0000 (GMT)
Subject: [Rd] Representation of floating point numbers (PR#1281)
In-Reply-To: <Pine.LNX.4.33.0201241512580.5000-100000@tal.stat.umu.se>
Message-ID: <XFMail.020124151558.theis@statistik.uni-dortmund.de>

Hello!
On 24-Jan-02 Gran Brostrm wrote:
> 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!
Sorry for being imprecise here: I missed the hint on all.equal on that page.

My main problem is that I need to find the places of a numerical vector x where
it equals its maximum, so usually I would do

> x[x==max(x)]

and this led to this whole discussion. I may be a bit dumb today but I don't
see an easy way to solve this with identical or all.equal. -- But please don't
bother, for the time being I will just round in the appropriate places. 

Sorry to have bothered you all with this.

Regards,
Winfried Theis
----------------------------------
E-Mail: Winfried Theis <theis@statistik.uni-dortmund.de>
Date: 24-Jan-02
Time: 15:04:41
Dipl.-Math. Winfried Theis, Fachbereich Statistik, Graduiertenkolleg
"Angewandte Statistik"
Universitt Dortmund, 44221 Dortmund
Tel.: +49-231-755-5903  FAX: +49-231-755-4387
----------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] Representation of floating point numbers (PR#1281)
Winfried Theis