mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Avoid changing the sign of zero. Per buildfarm failures.
This commit is contained in:
parent
6ba9b9102a
commit
7fc30c488f
@ -4,16 +4,16 @@
|
|||||||
* rint() implementation
|
* rint() implementation
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/port/rint.c,v 1.3 2010/02/05 03:20:56 momjian Exp $
|
* $PostgreSQL: pgsql/src/port/rint.c,v 1.4 2010/02/06 05:42:49 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "c.h"
|
#include "c.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
double
|
double
|
||||||
rint(double x)
|
rint(double x)
|
||||||
{
|
{
|
||||||
return (x > 0.0) ? floor(x + 0.5) : ceil(x - 0.5);
|
return (x >= 0.0) ? floor(x + 0.5) : ceil(x - 0.5);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user