From Thierry.ONKELINX at inbo.be  Mon Aug  3 09:50:34 2009
From: Thierry.ONKELINX at inbo.be (ONKELINX, Thierry)
Date: Mon, 3 Aug 2009 09:50:34 +0200
Subject: [Rd] incorrect result (41/10-1/10)%%1 (PR#13863)
In-Reply-To: <20090801200513.EC2A8282EF3D@mail.pubhealth.ku.dk>
References: <20090801200513.EC2A8282EF3D@mail.pubhealth.ku.dk>
Message-ID: <2E9C414912813E4EB981326983E0A10406A3BF6B@inboexch.inbo.be>

This is not a bug. It is a case of R FAQ 7.34:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-the
se-numbers-are-equal_003f 


------------------------------------------------------------------------
----
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics,
methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx at inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to
say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of
data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-devel-bounces at r-project.org
[mailto:r-devel-bounces at r-project.org] Namens jan.hattendorf at unibas.ch
Verzonden: zaterdag 1 augustus 2009 22:05
Aan: r-devel at stat.math.ethz.ch
CC: R-bugs at r-project.org
Onderwerp: [Rd] incorrect result (41/10-1/10)%%1 (PR#13863)

Full_Name: jan hattendorf
Version: 2.9.0
OS: XP
Submission from: (NULL) (213.3.108.185)


I get an incorrect result for

(41/10-1/10)%%1

[1] 1

The error did not occur with other numbers than 41 (1, 11, 21, 31, 51,
...)


test <- rep(NA, 1000)
for(i in 1:1000){
  test[i] <- i/10-1/10
}
test[test%%1==0]

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Dit bericht en eventuele bijlagen geven enkel de visie van de schrijver weer 
en binden het INBO onder geen enkel beding, zolang dit bericht niet bevestigd is
door een geldig ondertekend document. The views expressed in  this message 
and any annex are purely those of the writer and may not be regarded as stating 
an official position of INBO, as long as the message is not confirmed by a duly 
signed document.



[Rd] incorrect result (41/10-1/10)%%1 (PR#13863)
ONKELINX, Thierry