diff options
author | Tom Lane | 2010-02-06 05:42:49 +0000 |
---|---|---|
committer | Tom Lane | 2010-02-06 05:42:49 +0000 |
commit | 7fc30c488fc6e9674564206193c29b1a657a818f (patch) | |
tree | bb1873391ffd9286d7e67540d49205c75f495afe | |
parent | 6ba9b9102aade07fae0b7e8f10813a54d385b5a1 (diff) |
Avoid changing the sign of zero. Per buildfarm failures.
-rw-r--r-- | src/port/rint.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/port/rint.c b/src/port/rint.c index ff5aab087a0..0e32dd92720 100644 --- a/src/port/rint.c +++ b/src/port/rint.c @@ -4,16 +4,16 @@ * rint() implementation * * IDENTIFICATION - * $PostgreSQL: pgsql/src/port/rint.c,v 1.3 2010/02/05 03:20:56 momjian Exp $ + * $PostgreSQL: pgsql/src/port/rint.c,v 1.4 2010/02/06 05:42:49 tgl Exp $ * *------------------------------------------------------------------------- */ - #include "c.h" + #include <math.h> double rint(double x) { - return (x > 0.0) ? floor(x + 0.5) : ceil(x - 0.5); + return (x >= 0.0) ? floor(x + 0.5) : ceil(x - 0.5); } |