mirror of
https://github.com/postgres/postgres.git
synced 2026-03-02 13:24:01 -05:00
19 lines
355 B
C
19 lines
355 B
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* rint.c
|
|
* rint() implementation
|
|
*
|
|
* IDENTIFICATION
|
|
* 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);
|
|
}
|