#include <signal.h>
-#include "config.h"
+#include <config.h>
#include "lisp.h"
#include "syssignal.h"
#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. */
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;
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);
}
}
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;
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