Re: BUG #12885: The result of casting a double to an integer depends on the database version
От
Michael Paquier
Тема
Re: BUG #12885: The result of casting a double to an integer
depends on the database version
Дата
Msg-id
CAB7nPqST=EUbvsx-mapemgA0jD9e9sgVezaV-UvtkeMfXyrigw@mail.gmail.com
Ответ на
Re: BUG #12885: The result of casting a double to an integer depends on the database version (Tom Lane)
Список
Дерево обсуждения
BUG #12885: The result of casting a double to an integer depends on
the database version rschaaf@commoninf.com
Re: BUG #12885: The result of casting a double to an integer depends on the database version Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #12885: The result of casting a double to an integer
depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: BUG #12885: The result of casting a double to an integer
depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: BUG #12885: The result of casting a double to an integer depends on the database version Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #12885: The result of casting a double to an integer
depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: BUG #12885: The result of casting a double to an integer depends on the database version Tom Lane <tgl@sss.pgh.pa.us>
Re: BUG #12885: The result of casting a double to an integer
depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: BUG #12885: The result of casting a double to an integer depends
on the database version Pedro Gimeno <pgsql-004@personal.formauri.es>
Re: BUG #12885: The result of casting a double to an integer depends
on the database version Michael Paquier <michael.paquier@gmail.com>
Re: BUG #12885: The result of casting a double to an integer depends
on the database version Pedro Gimeno <pgsql-004@personal.formauri.es>
Re: BUG #12885: The result of casting a double to an integer depends
on the database version Pedro Gimeno <pgsql-004@personal.formauri.es>
Re: BUG #12885: The result of casting a double to an integer depends
on the database version Michael Paquier <michael.paquier@gmail.com>
Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: BUG #12885: The result of casting a double to an integer
depends on the database version Pedro Gimeno <pgsql-004@personal.formauri.es>
Re: Re: BUG #12885: The result of casting a double to an integer
depends on the database version Pedro Gimeno <pgsql-004@personal.formauri.es>
Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: BUG #12885: The result of casting a double to an integer
depends on the database version Pedro Gimeno <pgsql-004@personal.formauri.es>
Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Re: BUG #12885: The result of casting a double to an
integer depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Re: BUG #12885: The result of casting a double to an
integer depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: Re: BUG #12885: The result of casting a double to an
integer depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: Re: BUG #12885: The result of casting a double to an integer
depends on the database version Pedro Gimeno <pgsql-004@personal.formauri.es>
Re: Re: BUG #12885: The result of casting a double to an
integer depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: Re: BUG #12885: The result of casting a double to an
integer depends on the database version Dean Rasheed <dean.a.rasheed@gmail.com>
Re: Re: BUG #12885: The result of casting a double to an integer depends on the database version Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Re: BUG #12885: The result of casting a double to an
integer depends on the database version Michael Paquier <michael.paquier@gmail.com>
Re: Re: BUG #12885: The result of casting a double to an
integer depends on the database version Michael Paquier <michael.paquier@gmail.com>
On Mon, Mar 23, 2015 at 8:12 PM, Tom Lane wrote: > 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. I have done more testing (done only 9.3 with MinGW and MSVC before) and the failure can be reproduced on master and REL9_4_STABLE as well because visibly with MSVC 2010 the version of rint used is the one of src/port, which is defined like that: return (x >= 0.0) ? floor(x + 0.5) : ceil(x - 0.5); For example by passing 2.5, we would get 3.0, and not 2.0 (nearest even number). So isn't the problem here? -- Michael
В списке pgsql-bugs по дате отправления
От: Tom Lane
Дата: