Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 382F99FA4B2; Wed, 27 Dec 2006 19:47:12 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 05998-05; Wed, 27 Dec 2006 19:47:07 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by postgresql.org (Postfix) with ESMTP id 81F0E9FA4A0; Wed, 27 Dec 2006 19:47:07 -0400 (AST) Received: from out1.internal (unknown [10.202.2.149]) by out1.messagingengine.com (Postfix) with ESMTP id 98B5A59B69; Wed, 27 Dec 2006 18:46:00 -0500 (EST) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by out1.internal (MEProxy); Wed, 27 Dec 2006 18:46:00 -0500 X-Sasl-enc: nqJWTqNsuoEHKPT4j9cMvtAgDWyNYMioweOTe5cb3Bjh 1167263160 Received: from [10.10.0.130] (adsl-68-75-163-199.dsl.emhril.ameritech.net [68.75.163.199]) by mail.messagingengine.com (Postfix) with ESMTP id DD1B010F68; Wed, 27 Dec 2006 18:45:59 -0500 (EST) Message-ID: <459305F9.1060403@yahoo.com> Date: Wed, 27 Dec 2006 17:47:05 -0600 From: Roman Kononov User-Agent: Thunderbird 1.5.0.8 (X11/20061117) MIME-Version: 1.0 To: Tom Lane CC: pgsql-hackers@postgresql.org, Bruce Momjian , PostgreSQL-patches Subject: Re: [BUGS] BUG #2846: inconsistent and confusing handling References: <200612272123.kBRLNdg05533@momjian.us> <4592E915.4050901@yahoo.com> <25444.1167261571@sss.pgh.pa.us> In-Reply-To: <25444.1167261571@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=4.126 tagged_above=0 required=5 tests=AWL, BAYES_40, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, FORGED_YAHOO_RCVD X-Spam-Level: **** X-Archive-Number: 200612/169 X-Sequence-Number: 21845 On 12/27/2006 05:19 PM, Tom Lane wrote: > Roman Kononov writes: >> On 12/27/2006 03:23 PM, Bruce Momjian wrote: >>> Are you sure? As I remember, computation automatically upgrades to >>> 'double'. See this program and output: > >> This is platform- and compiler- dependent: > > ... and probably irrelevant, too. We should store the result into a > float4 variable and then test for isinf() on that; that eliminates the > question of whether the compiler did the multiply in a wider format or > not. You are right provided that you want to ignore underflows and silently produce zeros instead. If you go this way, I recommend to ignore overflows as well, and silently produce infinities and NaNs. Roman