Re: [HACKERS] Warning!! - Mailing list pgsql-hackers

From darcy@druid.net (D'Arcy J.M. Cain)
Subject Re: [HACKERS] Warning!!
Date
Msg-id m0zb6xO-0000eRC@druid.net
Whole thread Raw
In response to Re: [HACKERS] Warning!!  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] Warning!!
List pgsql-hackers
Thus spake Tom Lane
> And hardware-dependent, evidently, because I get the right thing on HP:
> 
> play=> select cash_mul_flt8('$1', '123.77');
> cash_mul_flt8
> -------------
> $123.77
> (1 row)

Works fine on NetBSD -current.

> !     *result = floor((*f) * (*c) + 0.5);

Is this correct?  What about "select cash_mul_flt8('$1', '123.99')?"
Wouldn't that convert it to 124.00?

> The other cash functions also need to be looked at for rounding
> sloppiness, so I see no point in committing this fix by its lonesome.
> 
> Lessee, who's the author of cash.c ... looks like it's D'Arcy ...
> D'Arcy, you wanna put this on your to-do list?

Well, I didn't do those portions but I can look at it at some point I
suppose.  I'm just not sure that it is as simple as suggested above.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] latest snapshot crashes backend
Next
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] Warning!!