On Mon, Feb 1, 2016 at 8:13 AM, Vitaly Burovoy <vitaly.buro...@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.

Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:

Reply via email to