[R] OSX-specific Bug in randomForest

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Thu Oct 24 12:04:51 CEST 2024


>>>>> "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.au using 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



More information about the R-help mailing list