Re: WIP: rewrite numeric division

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Michael Paesold" <mpaesold(at)gmx(dot)at>, "Bruce Momjian" <bruce(at)momjian(dot)us>, <pgsql-patches(at)postgresql(dot)org>
Subject: Re: WIP: rewrite numeric division
Date: 2007-07-17 19:48:43
Message-ID: 87y7heu7z8.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

> No, my proposed patch doesn't change that. It might be that we should
> provide an "integer division" operator for NUMERIC, so that you can get
> at the exact result of trunc(x/y).

I was also thinking that if the denominator had only factors of 2 and 5 we
could calculate the precision to be precisely enough to maintain the original
precision. Ie, nnnn/1000 should just give you n.nnn not n.nnn0000 and more
importantly it should never round.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2007-07-17 21:27:57 Re: Async Commit, v21 (now: v22)
Previous Message Simon Riggs 2007-07-17 18:31:15 Re: Async Commit, v21 (now: v22)