mirror of
https://github.com/postgres/postgres.git
synced 2025-08-12 15:23:02 +03:00
20 lines
355 B
C
20 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);
|
|
}
|