[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] New module to perform decimal floating point arithmetic for
From: |
Ben Pfaff |
Subject: |
Re: [PATCH] New module to perform decimal floating point arithmetic for charts. |
Date: |
Thu, 15 Jan 2015 07:51:10 -0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Jan 14, 2015 at 10:20:06AM +0100, John Darrington wrote:
> On Tue, Jan 13, 2015 at 09:24:37PM -0800, Ben Pfaff wrote:
>
> Can you say a few words about the assumptions? At first glance, some of
> the functions seem to suffer from catastrophic loss of precision upon
> integer overflow, e.g. doesn't that happen in decimal_multiply() if the
> intermediate result is greater than ORD_MAX? (Is some kind of care
> taken to make sure that this cannot happen?)
>
> Oh you are right. Actually decimal_multiply is unused, so I have removed it.
> But the same issue was in decimal_int_multiply. I have fixed this and
> added a test for it.
>
> Patch attached.
OK, I guess that function was just an oversight.
I'll take a closer look at the rest of the code later, but feel free to
check it in whenever you like. Bugs are always fixable ;-)