[R] Odd results with %% and conserving memory
Thomas Lumley
tlumley at u.washington.edu
Wed Apr 7 00:09:27 CEST 2010
On Tue, 6 Apr 2010, JustinNabble wrote:
> Likewise, identical( (4.1 * 100 ) %/% 1 , 409 ) returns TRUE on my computer,
> so the result is off by exactly 1, too larger to be explained by floating
> point error.
The result of (4.1 * 100 ) %/% 1 is an integer, so if it doesn't agree exactly it has to be off by at least 1, no matter how high the numerical precision.
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
tlumley at u.washington.edu University of Washington, Seattle
More information about the R-help
mailing list