Here is the full TODO item:
* Add NUMERIC division operator that doesn't round?
Currently NUMERIC _rounds_ the result to the specified precision.
This means division can return a result that multiplied by the
divisor is greater than the dividend, e.g
"Tom Lane" <[EMAIL PROTECTED]> writes:
> but I wouldn't want to defend the details of the rule about how many
> fractional digits out given so many fractional digits in.
In particular it seems to me this is poor:
postgres=# select 1::numeric/10;
?column?
On Tue, Mar 20, 2007 at 08:27:46PM -0400, Tom Lane wrote:
> and of course if you multiply that by 6 you get
>
> regression=# SELECT (10::numeric(2,0) / 6::numeric(2,0)) * 6;
> ?column?
> -
> 10.0002
> (1 row)
The only way to fix that is to shift from fixed-p
Chris Travers <[EMAIL PROTECTED]> writes:
> I have been looking at the TODO and have found something that I find
> sort of odd and we should probably reconsider:
> One of the items under data types is:
> * Add NUMERIC division operator that doesn't round?
> Currently NUMERIC _rounds_