X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 042DCD1B471 for ; Mon, 29 Dec 2003 19:46:06 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 65630-09 for ; Mon, 29 Dec 2003 15:45:18 -0400 (AST) Received: from corvette.mascari.com (uar225045.columbus.rr.com [204.210.225.45]) by svr1.postgresql.org (Postfix) with ESMTP id D09F7D1B480 for ; Mon, 29 Dec 2003 15:45:15 -0400 (AST) Received: from mascari.com (ferrari.mascari.com [192.168.2.1]) by corvette.mascari.com (8.11.6/8.11.6) with ESMTP id hBTJRkL18332; Mon, 29 Dec 2003 14:27:46 -0500 Message-ID: <3FF08032.4050403@mascari.com> Date: Mon, 29 Dec 2003 14:27:46 -0500 From: Mike Mascari User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: aspire420@hotpop.com Cc: pgsql-hackers@postgresql.org Subject: Re: IEEE 754 References: <3FF06449.7080208@sancharnet.in> In-Reply-To: <3FF06449.7080208@sancharnet.in> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-MailScanner: Found to be clean X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/767 X-Sequence-Number: 48671 Sai Hertz And Control Systems wrote: > Dear all , > > I would like to share my concerns about the IEEE 754 specification and > floating point handling by PostgreSQL . > > Also I would like to learn how professional users of PostgreSQL work > with rounding of monetary terms . > > If you would like to know whats IEEE 754 read this > http://docs.sun.com/source/806-3568/ncg_goldberg.html No sane human being would use floating point for monetary values. NUMERIC is an arbitrary precision type capable of effectively limitless scale and precision, although it is currently defined as having a limit of 1000: #define NUMERIC_MAX_PRECISION 1000 As far as rounding is concerned, it depends on the application. For example, in the United States at least, each state has devised their own rounding rules with respect to sales and use taxes. For a look at how very bad sausage is made: http://www.ecommercetax.com/official_docs/SSTP%20-%20Rounding.pdf Mike Mascari mascarm@mascari.com