Bug in floating-point addition: is anyone else seeing this?

Diez B. Roggisch deets at nospam.web.de
Wed May 21 18:21:38 EDT 2008


Dave Parker schrieb:
> On May 21, 3:19 pm, "Dan Upton" <up... at virginia.edu> wrote:
>> The fact is, sometimes it's better to get it fast and be good enough,
>> where you can use whatever methods you want to deal with rounding
>> error accumulation.
> 
> I agree.
> 
> I also think that the precision/speed tradeoff should be under user
> control -- not at the whim of the compiler writer.  So, for example,
> if a user says:
> 
>       Set realdecimaldigits to 10.
> 
> then it's okay to use hardware double precision, but if they say:
> 
>       Set realdecimaldigits to 100.
> 
> then it's not.  The user should always be able to specify the
> precision and the rounding mode, and the program should always provide
> correct results to those specifications.

Which is exactly what the python decimal module does.

Diez



More information about the Python-list mailing list