diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-12-16 01:25:23 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-12-16 01:25:23 +0000 |
commit | 7585deb0878bca96eee9a3e00fb5726c7725831c (patch) | |
tree | abbc9add268b6fbc32af0871f8d14f804681747b /src/backend/port/qnx/rint.c | |
parent | 9805abb0fb1d2d57834a233d1a34279757d3f068 (diff) | |
download | postgresql-7585deb0878bca96eee9a3e00fb5726c7725831c.tar.gz postgresql-7585deb0878bca96eee9a3e00fb5726c7725831c.zip |
I have done the QNX4 port with the current source tree. The number of
backend/Makefiles to be patched could significantly be reduced since
they
have been adopted to the QNX4 needs.
Andreas Kardos
Diffstat (limited to 'src/backend/port/qnx/rint.c')
-rw-r--r-- | src/backend/port/qnx/rint.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/backend/port/qnx/rint.c b/src/backend/port/qnx/rint.c new file mode 100644 index 00000000000..8d717425b2e --- /dev/null +++ b/src/backend/port/qnx/rint.c @@ -0,0 +1,31 @@ +/*------------------------------------------------------------------------- + * + * rint.c + * rint() implementation + * + * Copyright (c) 1999, repas AEG Automation GmbH + * + * + * IDENTIFICATION + * $Header: /cvsroot/pgsql/src/backend/port/qnx/Attic/rint.c,v 1.1 1999/12/16 01:25:06 momjian Exp $ + * + *------------------------------------------------------------------------- + */ + +#include <math.h> +#include "os.h" + +double rint(double x) +{ + double f, n = 0.; + + f = modf( x, &n ); + + if( x > 0. ) { + if( f > .5 ) n += 1.; + } + else if( x < 0. ) { + if( f < -.5 ) n -= 1.; + } + return n; +} |