aboutsummaryrefslogtreecommitdiff
path: root/src/backend/port/qnx4/rint.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/port/qnx4/rint.c')
-rw-r--r--src/backend/port/qnx4/rint.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/backend/port/qnx4/rint.c b/src/backend/port/qnx4/rint.c
index 2683ce849b7..4450d8c0567 100644
--- a/src/backend/port/qnx4/rint.c
+++ b/src/backend/port/qnx4/rint.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/rint.c,v 1.1 1999/12/16 16:52:52 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/port/qnx4/Attic/rint.c,v 1.2 2000/04/12 17:15:30 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -15,17 +15,23 @@
#include <math.h>
#include "os.h"
-double rint(double x)
+double
+rint(double x)
{
- double f, n = 0.;
+ double f,
+ n = 0.;
- f = modf( x, &n );
+ f = modf(x, &n);
- if( x > 0. ) {
- if( f > .5 ) n += 1.;
- }
- else if( x < 0. ) {
- if( f < -.5 ) n -= 1.;
- }
- return n;
+ if (x > 0.)
+ {
+ if (f > .5)
+ n += 1.;
+ }
+ else if (x < 0.)
+ {
+ if (f < -.5)
+ n -= 1.;
+ }
+ return n;
}