Re: [HACKERS] Minor bug in src/port/rint.c

2008-03-25 Thread Alvaro Herrera
Tom Lane wrote: The proper wording of this item is * Find a correct rint() substitute on Windows Fixed. -- Alvaro Herrerahttp://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc. -- Sent via pgsql-hackers mailing list

Re: [HACKERS] Minor bug in src/port/rint.c

2008-03-24 Thread Bruce Momjian
Added to TODO: o Fix port/rint.c to be spec-compliant http://archives.postgresql.org/pgsql-hackers/2008-01/msg00808.php --- Mark Cave-Ayland wrote: Hi everyone, I believe that there is a small bug

Re: [HACKERS] Minor bug in src/port/rint.c

2008-03-24 Thread Tom Lane
Bruce Momjian [EMAIL PROTECTED] writes: Added to TODO: o Fix port/rint.c to be spec-compliant Actually, the TODO I had in mind was entirely not that. Getting exact spec compliance in a completely platform-independent fashion is probably impossible, and is certainly not worth the

[HACKERS] Minor bug in src/port/rint.c

2008-01-20 Thread Mark Cave-Ayland
Hi everyone, I believe that there is a small bug in src/port/rint.c when the input parameter has a fractional part of 0.5 which is demonstrated by the attached program. It appears that the PG version of rint() rounds in the wrong direction with respect to glibc. [EMAIL PROTECTED]:~$ ./test

Re: [HACKERS] Minor bug in src/port/rint.c

2008-01-20 Thread Tom Lane
Mark Cave-Ayland [EMAIL PROTECTED] writes: I believe that there is a small bug in src/port/rint.c when the input parameter has a fractional part of 0.5 which is demonstrated by the attached program. It appears that the PG version of rint() rounds in the wrong direction with respect to glibc.

Re: [HACKERS] Minor bug in src/port/rint.c

2008-01-20 Thread Magnus Hagander
Tom Lane wrote: Mark Cave-Ayland [EMAIL PROTECTED] writes: I believe that there is a small bug in src/port/rint.c when the input parameter has a fractional part of 0.5 which is demonstrated by the attached program. It appears that the PG version of rint() rounds in the wrong direction with

Re: [HACKERS] Minor bug in src/port/rint.c

2008-01-20 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: Tom Lane wrote: Considering that probably every modern platform has rint(), I doubt it's worth spending time on our stopgap version to try to make it fully IEEE-compliant ... Except win32. Hasn't it got something equivalent? This is IEEE-required

Re: [HACKERS] Minor bug in src/port/rint.c

2008-01-20 Thread Tom Lane
Mark Cave-Ayland [EMAIL PROTECTED] writes: The big question is, of course, how much difference does this make? Probably not a lot. If we can find an IEEE-compliant rounding function on Windows, I'd be happy to see rint() fixed to call it; beyond that I think it's not worth troubling with.

Re: [HACKERS] Minor bug in src/port/rint.c

2008-01-20 Thread Magnus Hagander
Tom Lane wrote: Magnus Hagander [EMAIL PROTECTED] writes: Tom Lane wrote: Considering that probably every modern platform has rint(), I doubt it's worth spending time on our stopgap version to try to make it fully IEEE-compliant ... Except win32. Hasn't it got something equivalent? This

Re: [HACKERS] Minor bug in src/port/rint.c

2008-01-20 Thread Mark Cave-Ayland
On Sun, 2008-01-20 at 16:47 -0500, Tom Lane wrote: Your proposed fix wouldn't make it act the same as glibc, only move the differences around. I believe glibc's default behavior for the ambiguous cases is round to nearest even number. You propose replacing round towards zero, which is what