Helmut Schütz
2022-Feb-19 15:00 UTC
[R] Why does the print method fail for very small numbers?
Hi Marius, as others already noted, you request something which is beyond the numeric resolution. That's also elaborated in the famous FAQ 7.31 (https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f). As you know - according to IEEE 754 a binary in double precision holds 64 bits (where 1 bit is the sign, 11 the exponent, and 52 the mantissa). That translates into ~15.7 digits decimal. Hence, the 16th digit is noise. IMHO, print(foo, digits = bar) should provide the result but additionally throw for any bar > 15 a message like "From the hard-/software to the wetware: We cannot provide what you were asking for." Helmut -- Ing. Helmut Sch?tz BEBAC?? Consultancy Services for Bioequivalence and Bioavailability Studies Neubaugasse 36/11 1070 Vienna, Austria W https://bebac.at/ F https://forum.bebac.at/