Skip to content

Representation of floating point numbers (PR#1281)

4 messages · Winfried Theis, Göran Broström, David Brahm

#
On 24-Jan-02 Prof Brian Ripley wrote:
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.

Winfried Theis

----------------------------------
E-Mail: Winfried Theis <theis@statistik.uni-dortmund.de>
Date: 24-Jan-02
Time: 13:54:53
Dipl.-Math. Winfried Theis, Fachbereich Statistik, Graduiertenkolleg
"Angewandte Statistik"
Universität 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Thu, 24 Jan 2002 theis@statistik.uni-dortmund.de wrote:

            
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:
Clever indeed!
#
Hello!
On 24-Jan-02 Göran Broström wrote:
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
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"
Universität 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Winfried Theis writes:
Then you want which.max(x)  [a great function found in R but not S-Plus].