Re: WIP: rewrite numeric division - Mailing list pgsql-patches

From Gregory Stark
Subject Re: WIP: rewrite numeric division
Date
Msg-id 87y7heu7z8.fsf@oxford.xeocode.com
Whole thread Raw
In response to Re: WIP: rewrite numeric division  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
"Tom Lane" <tgl@sss.pgh.pa.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


pgsql-patches by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Async Commit, v21 (now: v22)
Next
From: Bruce Momjian
Date:
Subject: Re: Async Commit, v21 (now: v22)