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

Sean O'Riordain sean.oriordain at gmail.com
Mon Aug 3 09:43:57 CEST 2009


Good morning Jan,

Could this be covered off by the following?

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f

Kind regards,
Sean

On Sat, Aug 1, 2009 at 9:05 PM, <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
>



More information about the R-devel mailing list