>>>>> "pd" == peter dalgaard >>>>> on Thu, 24 Oct 2024 11:00:25 +0200 writes:
pd> This is probably Apple Silicon specific, not OSX per se: >> sum(rep(1 / 9, 9)) - 1 pd> [1] 0 >> On 23 Oct 2024, at 07:26 , Stevie Pederson >> <stephen.pederson...@gmail.com> wrote: >> >> sum(rep(1 / 9, 9)) - 1 # [1] 2.220446e-16 But indeed, it *is* a bug *always* to assume that double precision arithmetic is exact be it in R or not (unless you *know* that all the numbers involved are of the form <integer> * 2^k ; k in "around" (-1000):1000 ) Martin Maechler ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide https://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.