diff options
| author | Jim Blandy <jimb@redhat.com> | 1993-03-11 07:13:24 +0000 |
|---|---|---|
| committer | Jim Blandy <jimb@redhat.com> | 1993-03-11 07:13:24 +0000 |
| commit | 340176df06d5d6a274317c25f0d6e56fe8dd6403 (patch) | |
| tree | 83ceaf54dddf489854468a6629acbb22cd857eb8 /src/floatfns.c | |
| parent | a90538cbb5cbd3d79d608d5e360055a7279cbdf6 (diff) | |
| download | emacs-340176df06d5d6a274317c25f0d6e56fe8dd6403.tar.gz | |
* floatfns.c (Flogb): Undo the change of Feb 22.
Diffstat (limited to 'src/floatfns.c')
| -rw-r--r-- | src/floatfns.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/floatfns.c b/src/floatfns.c index 760b7449387..5ae4379c1be 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -615,15 +615,21 @@ DEFUN ("float", Ffloat, Sfloat, 1, 1, 0, } DEFUN ("logb", Flogb, Slogb, 1, 1, 0, - "Returns the integer that is the base 2 log of ARG.\n\ + "Returns the integer not greater than the base 2 log of the magnitude of ARG.\n\ This is the same as the exponent of a float.") (arg) Lisp_Object arg; { - /* System V apparently doesn't have a `logb' function. It might be - better to use it on systems that have it, but Ultrix (at least) - doesn't declare it properly in <math.h>; does anyone really care? */ - return Flog (arg, make_number (2)); +#ifdef USG + error ("SYSV apparently doesn't have a logb function; what to do?"); +#else + Lisp_Object val; + double f = extract_float (num); + + IN_FLOAT (val = logb (f), num); + XSET (val, Lisp_Int, val); + return val; +#endif } /* the rounding functions */ |
