From P.Dalgaard at biostat.ku.dk  Mon Aug  3 09:41:58 2009
From: P.Dalgaard at biostat.ku.dk (Peter Dalgaard)
Date: Mon, 03 Aug 2009 09:41:58 +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: <4A7694C6.8080307@biostat.ku.dk>

jan.hattendorf at unibas.ch wrote:
> 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

FAQ 7.31

-- 
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



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