Patch: make behavior of all versions of the "isinf" function be similar - Mailing list pgsql-hackers

From Vitaly Burovoy
Subject Patch: make behavior of all versions of the "isinf" function be similar
Date
Msg-id CAKOSWN=a60VfcaKTmg_=3HRLSEvvFyN6nKQY8KjsbJuoq9+ySw@mail.gmail.com
Whole thread Raw
Responses Re: Patch: make behavior of all versions of the "isinf" function be similar
List pgsql-hackers
Hello, hackers!

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.

It seems concrete values (not just "if isinf(...)") are checked only
in float.c in float4out and float8out, but I am going to check for
concrete values in my another patch.

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.

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.

P.S.: Should the patch be added to the next CF?

[1]https://docs.oracle.com/cd/E36784_01/html/E36874/fpclass-3c.html
--
Best regards,
Vitaly Burovoy

Attachment

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Template for commit messages
Next
From: Michael Paquier
Date:
Subject: Re: Template for commit messages