Skip to content

Commit 7fc30c4

Browse files
committed
Avoid changing the sign of zero. Per buildfarm failures.
1 parent 6ba9b91 commit 7fc30c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/port/rint.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
* rint() implementation
55
*
66
* IDENTIFICATION
7-
* $PostgreSQL: pgsql/src/port/rint.c,v 1.3 2010/02/05 03:20:56 momjian Exp $
7+
* $PostgreSQL: pgsql/src/port/rint.c,v 1.4 2010/02/06 05:42:49 tgl Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
11-
1211
#include "c.h"
12+
1313
#include <math.h>
1414

1515
double
1616
rint(double x)
1717
{
18-
return (x > 0.0) ? floor(x + 0.5) : ceil(x - 0.5);
18+
return (x >= 0.0) ? floor(x + 0.5) : ceil(x - 0.5);
1919
}

0 commit comments

Comments
 (0)