]> granicus.if.org Git - postgresql/blob - src/port/rint.c
Centralize single quote escaping in src/port/quotes.c
[postgresql] / src / port / rint.c
1 /*-------------------------------------------------------------------------
2  *
3  * rint.c
4  *        rint() implementation
5  *
6  * IDENTIFICATION
7  *        src/port/rint.c
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 }