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

From Thomas G. Lockhart
Subject Re: [HACKERS] Warning!!
Date
Msg-id 36400625.BCF605FD@alumni.caltech.edu
Whole thread Raw
In response to Re: [HACKERS] Warning!!  (A James Lewis <james@vrtx.net>)
Responses Re: [HACKERS] Warning!!  (A James Lewis <james@vrtx.net>)
Re: [HACKERS] Warning!!  (Bruce Momjian <maillist@candle.pha.pa.us>)
Re: [HACKERS] Warning!!  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> I'm very new to this list, and I have to first say that 6.4beta5 fixes
> every problem I had encountered with 6.3.2 (A small list..)
> Just now I saw and posted this...
> If the pence is 0-4 it rounds down... surely that's a rounding bug 
> because it should be looking at the next significant figure?

tgl=> select cash_mul_flt8('$123.77', '1');
cash_mul_flt8
-------------
$123.77
(1 row)

tgl=> select cash_mul_flt8('$1', '123.77');
cash_mul_flt8
-------------
$123.76
(1 row)

That's annoying; it's non-symmetric too. The money type is stored as an
integer, and the float type is an IEEE double; looks like we have an LSB
rounding problem. Not sure what to do about it other than remove the
function, which isn't desirable I'm sure...
                - Tom


pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] Warning!!
Next
From: Michael Meskes
Date:
Subject: Re: [HACKERS] Mixing library versions