Re: [HACKERS] Patch: make behavior of all versions of the "isinf" function be similar

2016-02-02 Thread Tom Lane
Vitaly Burovoy writes: > On 1/31/16, Tom Lane wrote: >> 2. POSIX:2008 only requires that "The isinf() macro shall return a >> non-zero value if and only if its argument has an infinite value." > Ok, then I'll use "is_infinite" from "float.c". Yeah,

Re: [HACKERS] Patch: make behavior of all versions of the "isinf" function be similar

2016-02-01 Thread Vitaly Burovoy
On 1/31/16, Tom Lane wrote: > 2. POSIX:2008 only requires that "The isinf() macro shall return a > non-zero value if and only if its argument has an infinite value." > Therefore, any assumption about the sign of the result is wrong anyway, > and any patch that depends on it

[HACKERS] Patch: make behavior of all versions of the "isinf" function be similar

2016-01-31 Thread Vitaly Burovoy
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

Re: [HACKERS] Patch: make behavior of all versions of the "isinf" function be similar

2016-01-31 Thread Michael Paquier
On Mon, Feb 1, 2016 at 2:38 PM, Michael Paquier wrote: > 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. Looking

Re: [HACKERS] Patch: make behavior of all versions of the "isinf" function be similar

2016-01-31 Thread Michael Paquier
On Mon, Feb 1, 2016 at 4:04 PM, Tom Lane wrote: > 1. I don't think the buildfarm is sufficient evidence to conclude that > isinf.c is required nowhere. It was in use as late as 2004, judging > by the git history, and I don't know of good reason to assume we do not > need it

Re: [HACKERS] Patch: make behavior of all versions of the "isinf" function be similar

2016-01-31 Thread Tom Lane
Michael Paquier writes: > On Mon, Feb 1, 2016 at 2:38 PM, Michael Paquier > wrote: >> 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

Re: [HACKERS] Patch: make behavior of all versions of the "isinf" function be similar

2016-01-31 Thread Michael Paquier
On Mon, Feb 1, 2016 at 8:13 AM, Vitaly Burovoy 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