Re: [HACKERS] Warning!!

From: A James Lewis <james(at)vrtx(dot)net>
To: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, The Hermit Hacker <scrappy(at)hub(dot)org>, darcy(at)druid(dot)net, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Warning!!
Date: 1998-11-04 13:37:10
Message-ID: Pine.LNX.3.93.981104131603.18393C-100000@vr1-workhorse1.vrtx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Don't remove it... After all, I'm using this workaround in my software
for now and it seems OK....

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

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

It happens in float4 too....

On Wed, 4 Nov 1998, Thomas G. Lockhart wrote:

> > 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
>

James (james(at)linuxrocks(dot)co(dot)uk)
Vortex Internet
My Windows unders~1 long filena~1, and yours?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-11-04 13:57:57 Re: [HACKERS] Warning!!
Previous Message Oliver Elphick 1998-11-04 13:09:03 latest snapshot crashes backend