From ce7a46faa25c6af6179206dbe380c118e84b1089 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Tue, 28 Mar 2000 21:37:23 +0200
Subject: [PATCH] Now sets the floatingpoint rounding mode to round to nearest.

Rev: src/modules/_math/math.c:1.28
---
 src/modules/_math/math.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/modules/_math/math.c b/src/modules/_math/math.c
index 2d44bf98cf..161248c8a5 100644
--- a/src/modules/_math/math.c
+++ b/src/modules/_math/math.c
@@ -27,7 +27,7 @@
 #include <floatingpoint.h>
 #endif
 
-RCSID("$Id: math.c,v 1.27 1999/12/11 19:30:41 grubba Exp $");
+RCSID("$Id: math.c,v 1.28 2000/03/28 19:37:23 grubba Exp $");
 
 #ifndef M_PI
 #define M_PI 3.1415926535897932384626433832795080
@@ -288,6 +288,12 @@ void pike_module_init(void)
 #ifdef HAVE_FPSETMASK
   fpsetmask(0);
 #endif
+#ifdef HAVE_FPSETROUND
+#ifndef FP_RN
+#define FP_RN 0
+#endif
+  fpsetround(FP_RN);
+#endif /* HAVE_FPSETROUND */
   
 /* function(float:float) */
   ADD_EFUN("sin",f_sin,tFunc(tFlt,tFlt),0);
-- 
GitLab