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 CAB7nPqRRyhDtNMKC=vuTpO8XRwMEigyFh2VttnkC_eE7LbTAXQ@mail.gmail.com
обсуждение исходный текст
Ответ на 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  (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>)
Список pgsql-bugs
On Tue, Mar 24, 2015 at 7:11 PM, Pedro Gimeno
<pgsql-004@personal.formauri.es> wrote:
> Michael Paquier wrote, On 2015-03-25 01:19:
>> Hence I'd rather think that patching src/port is the way to go, with
>> for example something like the patch attached.
>
> There are some corner cases that that patch does not handle properly,
> most notably doubles that would overflow an integer. I suggest the
> attached implementation (it's not as a patch, though). I've included a
> test suite. The function can deal with non-IEEE floats too, but some of
> the tests assume IEEE doubles.

copysign is not that portable, at least it is not in the MSVC world.
So as a patch you would get something like the attached with what you
wrote.
--
Michael

Вложения

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: minor: contrib/btree_gin/btree_gin.c uses DirectFunctionCall3(inet_in,..)
Следующее
От: Pedro Gimeno
Дата:
Сообщение: Re: BUG #12885: The result of casting a double to an integer depends on the database version