Kaiting Chen <ktche...@gmail.com> writes: > Hi everyone. I’m trying to perform some exact precision arithmetic with > PostgreSQL’s NUMERIC type. However I can’t seem to get the unparameterized > NUMERIC type to perform exact precision arithmetic:
Division is inherently inexact, except in special cases. If you think that 1/(2^64) should be carried out to enough digits to be exact, what would you have us do with 1/3? The actual behavior is that it will choose a result scale (number of digits after the decimal point) that is dependent on the scales of the input arguments, but not on their precise values. I don't recall the details beyond that. regards, tom lane -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general