OSDN Git Service

Update a number of broken links in comments.
[pg-rex/syncrep.git] / src / port / rint.c
1 /*-------------------------------------------------------------------------
2  *
3  * rint.c
4  *        rint() implementation
5  *
6  * IDENTIFICATION
7  *        $PostgreSQL: pgsql/src/port/rint.c,v 1.4 2010/02/06 05:42:49 tgl Exp $
8  *
9  *-------------------------------------------------------------------------
10  */
11 #include "c.h"
12
13 #include <math.h>
14
15 double
16 rint(double x)
17 {
18         return (x >= 0.0) ? floor(x + 0.5) : ceil(x - 0.5);
19 }