]> code.delx.au - gnu-emacs/blobdiff - src/floatfns.c
Merge from emacs-24; up to 2012-12-06T01:39:03Z!monnier@iro.umontreal.ca
[gnu-emacs] / src / floatfns.c
index 4fe209fcb61c347ffd929ab6750326c70557867f..43576a16248dcbc3dcfc2590330d33a4fc278043 100644 (file)
@@ -1,7 +1,7 @@
 /* Primitive operations on floating point for GNU Emacs Lisp interpreter.
 
-Copyright (C) 1988, 1993-1994, 1999, 2001-2012
-  Free Software Foundation, Inc.
+Copyright (C) 1988, 1993-1994, 1999, 2001-2013 Free Software Foundation,
+Inc.
 
 Author: Wolfgang Rupprecht
 (according to ack.texi)
@@ -31,15 +31,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <config.h>
 
 #include "lisp.h"
-#include "syssignal.h"
-
-#include <float.h>
-#if (FLT_RADIX == 2 && FLT_MANT_DIG == 24 \
-     && FLT_MIN_EXP == -125 && FLT_MAX_EXP == 128)
-#define IEEE_FLOATING_POINT 1
-#else
-#define IEEE_FLOATING_POINT 0
-#endif
 
 #include <math.h>
 
@@ -408,8 +399,8 @@ round2 (EMACS_INT i1, EMACS_INT i2)
      odd.  */
   EMACS_INT q = i1 / i2;
   EMACS_INT r = i1 % i2;
-  EMACS_INT abs_r = r < 0 ? -r : r;
-  EMACS_INT abs_r1 = (i2 < 0 ? -i2 : i2) - abs_r;
+  EMACS_INT abs_r = eabs (r);
+  EMACS_INT abs_r1 = eabs (i2) - abs_r;
   return q + (abs_r + (q & 1) <= abs_r1 ? 0 : (i2 ^ r) < 0 ? -1 : 1);
 }