Re: [R] [External] Funky calculations

2022-02-02 Thread Avi Gross via R-help
As discussed, Tim, your version of R has already built-in all kinds of values and limits and even ways to do approximate tests in the variable .Machine such as: > .Machine$double.eps [1] 2.220446e-16 > .Machine$sizeof.longdouble [1] 16 > .Machine$double.eps [1] 2.220446e-16 > .Machine$longdouble

Re: [R] [External] Funky calculations

2022-02-02 Thread Bill Dunlap
Floats have 23 bits of precision so the rounding is done there instead of at 52 bits, hence a different example is needed to show the problem with floats. bill@Bill-T490:~$ cat b.c #include int main(int argc, char* argv[]) { float d = 0.4 + 0.4 + 0.4 + 0.4; printf("0.4+0.4+0.4+0.4 -> %24