X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3E78A5E46E7 for ; Tue, 24 Aug 2004 23:48:15 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49732-02 for ; Wed, 25 Aug 2004 02:48:15 +0000 (GMT) Received: from millenium.mst.co.jp (unknown [210.230.185.241]) by svr1.postgresql.org (Postfix) with ESMTP id 80BE25E46C4 for ; Tue, 24 Aug 2004 23:48:12 -0300 (ADT) Received: from mst1x5r347kymb (lc12114 [192.168.1.114]) by millenium.mst.co.jp (8.11.6p2/3.7W) with SMTP id i7P2m1q09346; Wed, 25 Aug 2004 11:48:01 +0900 Message-ID: <008101c48a4d$f5cd64d0$7201a8c0@mst1x5r347kymb> From: "Iain" To: "Stephan Szabo" Cc: "Adam Lancaster" , References: <8758F8D58219684FAB0239EE8967048A010807@calculon.preventsys.com> <200408241252.30182.josh@agliodbs.com> <1093378875.15248.39.camel@linda> <005b01c48a43$630db0a0$7201a8c0@mst1x5r347kymb> <20040824183612.M67501@megazone.bigpanda.com> Subject: Re: Possible rounding error of large float values? Date: Wed, 25 Aug 2004 11:48:11 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/261 X-Sequence-Number: 18758 > I don't think that's true since the number ending in 807 is equal to a > version ending in 808. > > sszabo=# select 9223372036854775807 = 9223372036854775808::float; > ?column? > ---------- > t > (1 row) Good point. I think that the problems with using floats are well documented (I particulary like the doc that come with IBMs java.lang.BigDecimal package) so there shouldn't be any excuse for being surprised by how they behave. Basically floats are fine when used for what they were desgned for, but a liability otherwise. Just thinking about it now, I can't remember last time I designed a database that used float data... regards Iain