diff src/floatfns.c @ 4865:6c0bb4d2c23a

Always use our rint(), for rounding consistency with the bignum code. ChangeLog addition: 2010-01-16 Aidan Kehoe <kehoea@parhasard.net> * configure: Regenerate, now we no longer look for rint(). src/ChangeLog addition: 2010-01-16 Aidan Kehoe <kehoea@parhasard.net> * config.h.in: * floatfns.c (emacs_rint): Don't look for rint in configure, always use our own implementation that rounds to the even number in the case of ambiguity, for consistency with the bignum code.
author Aidan Kehoe <kehoea@parhasard.net>
date Sat, 16 Jan 2010 19:04:52 +0000
parents f31c12360354
children 6ef8256a020a 19a72041c5ed
line wrap: on
line diff
--- a/src/floatfns.c	Thu Jan 14 20:55:10 2010 -0500
+++ b/src/floatfns.c	Sat Jan 16 19:04:52 2010 +0000
@@ -26,7 +26,6 @@
 
    Define HAVE_INVERSE_HYPERBOLIC if you have acosh, asinh, and atanh.
    Define HAVE_CBRT if you have cbrt().
-   Define HAVE_RINT if you have rint().
    If you don't define these, then the appropriate routines will be simulated.
 
    Define HAVE_MATHERR if on a system supporting the SysV matherr() callback.
@@ -50,11 +49,8 @@
 #include "syssignal.h"
 #include "sysfloat.h"
 
-/* The code uses emacs_rint, so that it works to undefine HAVE_RINT
-   if `rint' exists but does not work right.  */
-#ifdef HAVE_RINT
-#define emacs_rint rint
-#else
+/* An implementation of rint that always rounds towards the even number in
+   the case of ambiguity. */
 static double
 emacs_rint (double x)
 {
@@ -65,7 +61,6 @@
     r += r < x ? 1.0 : -1.0;
   return r;
 }
-#endif
 
 /* Nonzero while executing in floating point.
    This tells float_error what to do.  */