Re: [HACKERS] Warning!!

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: lockhart(at)alumni(dot)caltech(dot)edu (Thomas G(dot) Lockhart), pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Warning!!
Date: 1998-11-04 17:42:58
Message-ID: m0zb6xO-0000eRC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at){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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas G. Lockhart 1998-11-04 17:49:22 Re: [HACKERS] Warning!!
Previous Message Bruce Momjian 1998-11-04 17:41:50 Re: [HACKERS] latest snapshot crashes backend