Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 8057B9FB43C for ; Tue, 17 Apr 2007 17:53:53 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 12248-01-9 for ; Tue, 17 Apr 2007 17:53:44 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id D036A9FB84E for ; Tue, 17 Apr 2007 17:53:24 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1Hdufz-0002OM-LX for pgsql-sql@postgresql.org; Tue, 17 Apr 2007 16:53:23 -0400 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id 2B9834050; Tue, 17 Apr 2007 16:53:18 -0400 (EDT) Date: Tue, 17 Apr 2007 16:53:18 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Floating point type to store numbers Message-ID: <20070417205318.GC9094@phlogiston.dyndns.org> References: <4838.63.118.86.10.1176836034.squirrel@www.88thstreet.com> <20070417190443.GA9094@phlogiston.dyndns.org> <19968.63.118.86.10.1176842013.squirrel@www.88thstreet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19968.63.118.86.10.1176842013.squirrel@www.88thstreet.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/157 X-Sequence-Number: 28157 On Tue, Apr 17, 2007 at 04:33:33PM -0400, Radhika Sambamurti wrote: > Andrew, > This has been quite helpful. My main concern is CPU cost. Thanks for the > input. You're welcome. Are you sure your main concern should be CPU cost? It's true that numeric is more costly that float in a lot of cases, but I know at least one auditor who will refuse to certify results from programs that anywhere use floating-point storage or calculation on accounting data. The problem is really that you can get compound errors -- very small rounding errors several times can turn out to be a big problem. (One quick primer that can help you understand this is at .) A -- Andrew Sullivan | ajs@crankycanuck.ca The whole tendency of modern prose is away from concreteness. --George Orwell