[R] [Rd] Floating point precision / guard digits? (PR#13771)

Dr. D. P. Kreil dpkreil at gmail.com
Sun Jun 21 00:27:14 CEST 2009


Yes, I see the problem now! Thank you for bearing with me and for the
helpful explanations and info.

Best regards,
David.


2009/6/20 Stavros Macrakis <macrakis at alum.mit.edu>:
> On Sat, Jun 20, 2009 at 4:10 PM, Dr. D. P. Kreil <dpkreil at gmail.com> wrote:
>>
>> Ah, that's probably where I went wrong. I thought R would take the
>> "0.1", the "0.3", the "3", convert them to extended precision binary
>> representations, do its calculations, an the reduction to normal
>> double precision binary floats would only happen when the result was
>> stored or printed.
>
> This proposal is problematic in many ways.  For example, it would *still*
> not guarantee that 0.3 - 3*0.1 == 0, since extended-precision floats have
> the same characteristics as normal-precision floats.  Would you round to
> normal precision when passing arguments?  Then sqrt could not produce
> extended-precision results. etc. etc.
>
> I suppose R could support an extended-precision floating-point type, but
> that would require that the *user* choose which operations were in
> extended-precision and which in normal precision. (And of course it would be
> a lot of work to add in a complete and consistent way.)
>
>            -s
>




More information about the R-help mailing list