X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id AD0ABD1B4F1 for ; Tue, 28 Oct 2003 20:33:54 +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 59222-10 for ; Tue, 28 Oct 2003 16:33:25 -0400 (AST) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id E4FF0D1B51A for ; Tue, 28 Oct 2003 16:33:21 -0400 (AST) Received: (qmail 14319 invoked by uid 500); 28 Oct 2003 20:31:19 -0000 Date: Tue, 28 Oct 2003 14:31:19 -0600 From: Bruno Wolff III To: SZUCS =?iso-8859-1?Q?G=E1bor?= Cc: pgsql-sql@postgresql.org Subject: Re: numeric and float converts to int differently? Message-ID: <20031028203119.GB14260@wolff.to> Mail-Followup-To: SZUCS =?iso-8859-1?Q?G=E1bor?= , pgsql-sql@postgresql.org References: <87brs1gr4y.fsf@stark.dyndns.tv> <0acb01c39d90$6d9d9080$0403a8c0@fejleszt4> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0acb01c39d90$6d9d9080$0403a8c0@fejleszt4> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/372 X-Sequence-Number: 15772 On Tue, Oct 28, 2003 at 21:16:53 +0100, SZUCS Gábor wrote: > > As Tom pointed out, it isn't a floating point failure -- it is how rounding > float is implemented. I assume anything with less than 15 digits can be > exactly represented as float. No. It has to be a dyadic number. For example .3 will not be represented exactly by a float.