From: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
---|---|
To: | Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Patch: make behavior of all versions of the "isinf" function be similar |
Date: | 2016-02-01 05:38:19 |
Message-ID: | CAB7nPqTfMO-=or9mzwaTc29i_rpzzqmTeFMHdUOyN83jsu1myA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Feb 1, 2016 at 8:13 AM, Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2016-02-01 05:55:17 | Re: Patch: make behavior of all versions of the "isinf" function be similar |
Previous Message | Amit Kapila | 2016-02-01 05:27:53 | Re: [PATCH] Refactoring of LWLock tranches |