Commit c26406fe authored by Jim Blandy's avatar Jim Blandy

* floatfns.c (logb): Add extern declaration for this.

	* floatfns.c (Flogb): Under SYSV, implement this using frexp.
parent 6758394b
......@@ -55,6 +55,9 @@ Lisp_Object Qarith_error;
#include <math.h>
/* These declarations are omitted on some systems, like Ultrix. */
extern double logb ();
#if defined(DOMAIN) && defined(SING) && defined(OVERFLOW)
/* If those are defined, then this is probably a `matherr' machine. */
......@@ -620,17 +623,23 @@ This is the same as the exponent of a float.")
Lisp_Object arg;
#ifdef USG
error ("SYSV apparently doesn't have a logb function; what to do?");
Lisp_Object val;
int value;
double f = extract_float (arg);
#ifdef USG
int exp;
IN_FLOAT (frexp (f, &exp), "logb", arg);
XSET (val, Lisp_Int, exp-1);
IN_FLOAT (value = logb (f), "logb", arg);
XSET (val, Lisp_Int, value);
return val;
return val;
/* the rounding functions */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment