Re: dividing money by money

From: Andy Balholm <andy(at)balholm(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: dividing money by money
Date: 2010-07-17 14:20:45
Message-ID: 4D1A6144-3423-4D92-AEF3-FF05DC4D603D@balholm.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-www

On Jul 17, 2010, at 3:20 AM, Peter Eisentraut wrote:

> On fre, 2010-07-16 at 10:31 -0400, Tom Lane wrote:
>> The other argument that I found convincing was that if the
>> operator was defined to yield numeric, people might think that
>> the result was exact ... which of course it won't be, either way.
>> Choosing float8 helps to remind the user it's an approximate quotient.
>
> Why is it approximate? Aren't money values really integers?

$1.00 / 3.00 = 0.333333333333333333333333333333333333333333333333...

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2010-07-17 14:39:14 Re: dividing money by money
Previous Message Tom Lane 2010-07-17 14:16:15 Re: suppress automatic recovery after back crash

Browse pgsql-www by date

  From Date Subject
Next Message Tom Lane 2010-07-17 14:39:14 Re: dividing money by money
Previous Message Peter Eisentraut 2010-07-17 10:20:54 Re: dividing money by money