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

ONKELINX, Thierry Thierry.ONKELINX at inbo.be
Mon Aug 3 09:50:34 CEST 2009


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.



More information about the R-devel mailing list