[Rd] bug in modulus operator %% (PR#7852)

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed May 11 20:28:05 CEST 2005


kjetil at acelerate.com writes:

> The following can't be right,
> first rw2010:
> 
>  > 1 %% 0.001
> [1] 0.001
> 
> Then rw2001:
> 
>  > 1 %% 0.001
> [1] -2.081668e-17
>  >
> 
> and the last seems about right.  

A negative remainder? I don't think so. Presumably the result comes
from

    o   %% now warns if its accuracy is likely to be affected by lack
        of precision (as in 1e18 %% 11, the unrealistic expectation of
        PR#7409), and tries harder to return a value in range when it
        is.

So, not a bug.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907



More information about the R-devel mailing list