From: | Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Patch: make behavior of all versions of the "isinf" function be similar |
Date: | 2016-01-31 23:13:05 |
Message-ID: | CAKOSWN=a60VfcaKTmg_=3HRLSEvvFyN6nKQY8KjsbJuoq9+ySw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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 | Content-Type | Size |
---|---|---|
isinf_v1.patch | application/octet-stream | 254 bytes |
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2016-02-01 00:34:15 | Re: Template for commit messages |
Previous Message | Alvaro Herrera | 2016-01-31 22:30:12 | Re: Template for commit messages |