Re: Patch: make behavior of all versions of the "isinf" function be similar
От | Michael Paquier |
---|---|
Тема | Re: Patch: make behavior of all versions of the "isinf" function be similar |
Дата | |
Msg-id | CAB7nPqTfMO-=or9mzwaTc29i_rpzzqmTeFMHdUOyN83jsu1myA@mail.gmail.com обсуждение исходный текст |
Ответ на | Patch: make behavior of all versions of the "isinf" function be similar (Vitaly Burovoy <vitaly.burovoy@gmail.com>) |
Ответы |
Re: Patch: make behavior of all versions of the "isinf"
function be similar
|
Список | pgsql-hackers |
On Mon, Feb 1, 2016 at 8:13 AM, Vitaly Burovoy <vitaly.burovoy@gmail.com> wrote: > While I was searching for a function which checks doubles for > infinity, I discovered a function "isinf" in a file src/port/isinf.c > where one of three versions returns different value for "-inf" ("1" > instead of "-1") comparing to the other two. > > For systems with HAVE_FPCLASS the function returns the same result for > both "+inf" and "-inf". I can't test it on my WS, but I found only one > man page[1] where system header file "ieeefp.h" must be included for > ability to use "fpclass" function. That's the case on OSX, but on Linux -1 is returned for -Inf, and 1 for +Inf. > I guess nothing will be broken if that version of the function returns > the same results for input values as the other two. > Proposed patch makes that behavior. Actually, is there actually a reason to keep this file in the code tree? Are there platforms that do not have isinf()? Even for Windows environments using MSVC < 1800 this is emulated using _fpclass. -- Michael
В списке pgsql-hackers по дате отправления: