]> code.delx.au - gnu-emacs/blobdiff - src/floatfns.c
(message): Use message2, not message1.
[gnu-emacs] / src / floatfns.c
index 6b0f68585cd217b30bea360dc6b8afb3a0a0e7b3..b31f0baee2744a756f8fd750ba4230c8ad4c432f 100644 (file)
@@ -45,7 +45,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #include <signal.h>
 
-#include "config.h"
+#include <config.h>
 #include "lisp.h"
 #include "syssignal.h"
 
@@ -53,12 +53,22 @@ Lisp_Object Qarith_error;
 
 #ifdef LISP_FLOAT_TYPE
 
+/* Work around a problem that happens because math.h on hpux 7
+   defines two static variables--which, in Emacs, are not really static,
+   because `static' is defined as nothing.  The problem is that they are
+   defined both here and in lread.c.
+   These macros prevent the name conflict.  */
+#if defined (HPUX) && !defined (HPUX8)
+#define _MAXLDBL floatfns_maxldbl
+#define _NMAXLDBL floatfns_nmaxldbl
+#endif
+
 #include <math.h>
 
-#ifndef hpux
-/* These declarations are omitted on some systems, like Ultrix.  */
+/* This declaration is omitted on some systems, like Ultrix.  */
+#if !defined (hpux) && defined (HAVE_LOGB)
 extern double logb ();
-#endif
+#endif /* !hpux && HAVE_LOGB */
 
 #if defined(DOMAIN) && defined(SING) && defined(OVERFLOW)
     /* If those are defined, then this is probably a `matherr' machine. */
@@ -402,8 +412,8 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
 
   CHECK_NUMBER_OR_FLOAT (arg1, 0);
   CHECK_NUMBER_OR_FLOAT (arg2, 0);
-  if ((XTYPE (arg1) == Lisp_Int) && /* common lisp spec */
-      (XTYPE (arg2) == Lisp_Int)) /* don't promote, if both are ints */
+  if (XTYPE (arg1) == Lisp_Int     /* common lisp spec */
+      && XTYPE (arg2) == Lisp_Int) /* don't promote, if both are ints */
     {                          /* this can be improved by pre-calculating */
       int acc, x, y;           /* some binary powers of x then accumulating */
       Lisp_Object val;
@@ -444,7 +454,7 @@ DEFUN ("expt", Fexpt, Sexpt, 2, 2, 0,
   else if ((f1 == 0.0 && f2 < 0.0) || (f1 < 0 && f2 != floor(f2)))
     domain_error2 ("expt", arg1, arg2);
 #endif
-  IN_FLOAT (f1 = pow (f1, f2), "expt", arg1);
+  IN_FLOAT2 (f1 = pow (f1, f2), "expt", arg1, arg2);
   return make_float (f1);
 }
 
@@ -626,7 +636,7 @@ DEFUN ("float", Ffloat, Sfloat, 1, 1, 0,
 }
 
 DEFUN ("logb", Flogb, Slogb, 1, 1, 0,
-  "Returns the integer not greater than the base 2 log of the magnitude of ARG.\n\
+  "Returns largest integer <= the base 2 log of the magnitude of ARG.\n\
 This is the same as the exponent of a float.")
      (arg)
      Lisp_Object arg;
@@ -647,7 +657,8 @@ This is the same as the exponent of a float.")
     XSET (val, Lisp_Int, exp-1);
   }
 #else
-  Well, what *do* you have?
+  /* Would someone like to write code to emulate logb?  */
+  error ("`logb' not implemented on this operating system");
 #endif
 #endif