Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 0304E9FA4F4 for ; Tue, 17 Apr 2007 19:10:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 76624-09 for ; Tue, 17 Apr 2007 19:10:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by postgresql.org (Postfix) with ESMTP id 209B39FA5DD for ; Tue, 17 Apr 2007 19:10:05 -0300 (ADT) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Hdvs8-0001l7-Dk for pgsql-sql@postgresql.org; Wed, 18 Apr 2007 00:10:00 +0200 Received: from 85.187.136.11 ([85.187.136.11]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Apr 2007 00:10:00 +0200 Received: from milen by 85.187.136.11 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 18 Apr 2007 00:10:00 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-sql@postgresql.org From: "Milen A. Radev" Subject: Re: Floating point type to store numbers Date: Wed, 18 Apr 2007 01:09:53 +0300 Lines: 27 Message-ID: References: <4838.63.118.86.10.1176836034.squirrel@www.88thstreet.com> <20944.63.118.86.10.1176842180.squirrel@www.88thstreet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 85.187.136.11 User-Agent: Thunderbird 2.0.0.0 (Windows/20070326) In-Reply-To: <20944.63.118.86.10.1176842180.squirrel@www.88thstreet.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/158 X-Sequence-Number: 28158 Radhika Sambamurti написа: >> I believe the manual is quite clear on that one ( >> http://www.postgresql.org/docs/current/static/datatype-numeric.html#DATATYPE-FLOAT) >> : >> >> " - If you require exact storage and calculations (such as for monetary >> amounts), use the numeric type instead." >> >> >> So if you decide to use floats after this warning you are on your own. > > Well, actually the manual is not quite clear on this one. Given your requirements - "an application which is used for trading and back office operations." and "our monetary fields...", I still believe the manual is crystal clear. > It says quite clearly that very very small values approaching zero and > very very large values will be problematic. But I am not calculating the > distance to the moon. I need values to be accurate upto the 6th decimal > place, and was wondering if people use floating point types for this sort > of thing. -- Milen A. Radev