Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YaFGH-0003ec-RB for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Mar 2015 03:12:13 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YaFGH-0005su-2I for pgsql-bugs@arkaria.postgresql.org; Tue, 24 Mar 2015 03:12:13 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YaFGF-0005sl-0Q for pgsql-bugs@postgresql.org; Tue, 24 Mar 2015 03:12:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YaFG7-0000E7-IE for pgsql-bugs@postgresql.org; Tue, 24 Mar 2015 03:12:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t2O3C0s4026863; Mon, 23 Mar 2015 23:12:00 -0400 From: Tom Lane To: Michael Paquier cc: rschaaf@commoninf.com, pgsql-bugs@postgresql.org Subject: Re: BUG #12885: The result of casting a double to an integer depends on the database version In-reply-to: References: <20150320194337.2573.72944@wrigleys.postgresql.org> <32478.1427122083@sss.pgh.pa.us> Comments: In-reply-to Michael Paquier message dated "Mon, 23 Mar 2015 19:42:16 -0700" Date: Mon, 23 Mar 2015 23:12:00 -0400 Message-ID: <26862.1427166720@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Michael Paquier writes: > On Tue, Mar 24, 2015 at 11:27 AM, Michael Paquier wrote: >> On a Windows 7 box with code compiled with MSVC 2010 I am seeing the >> same behavior as Rich. This looks like a bug in ~9.3 that meritates >> some attention assuming that the latter behavior is legit. > And MinGW outputs the latter, similarly to other platforms... I'll investigate. Look for something about setting the IEEE float rounding mode. "Round to nearest even" is standard in most places, but it would not astonish me to hear that Microsoft got that wrong. If it is wrong I don't know that we'd want to back-patch a behavioral change, but I'd definitely vote for conforming to the norm in 9.5 and later. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs