[R] R wrong, Python rigth in calcution

Ivan Krylov kry|ov@r00t @end|ng |rom gm@||@com
Wed Sep 18 00:09:35 CEST 2019


On Wed, 18 Sep 2019 00:02:47 +0200
Martin Møller Skarbiniks Pedersen <traxplayer using gmail.com> wrote:

> I know I can use gmp and R will do it correctly.

Which is equivalent to what Python does: it uses so-called long
arithmetic, allowing scalar variables with as many digits as it fits in
the computer memory. R by default uses floating-point arithmetic, which
is subject to problems described in [*].

-- 
Best regards,
Ivan

[*] https://www.itu.dk/~sestoft/bachelor/IEEE754_article.pdf or
https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html



More information about the R-help mailing list