postgresql/src/port/rint.c

20 lines
355 B
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* rint.c
* rint() implementation
*
* IDENTIFICATION
2010-09-20 22:08:53 +02:00
* src/port/rint.c
*
*-------------------------------------------------------------------------
*/
#include "c.h"
#include <math.h>
double
rint(double x)
{
return (x >= 0.0) ? floor(x + 0.5) : ceil(x - 0.5);
}