Mercurial > emacs
comparison src/floatfns.c @ 2119:4077ef8ad483
* floatfns.c (Flogb): Undo the change of Feb 22.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Thu, 11 Mar 1993 07:13:24 +0000 |
parents | c77607f8e32d |
children | 28d83027277f |
comparison
equal
deleted
inserted
replaced
2118:454228f1c526 | 2119:4077ef8ad483 |
---|---|
613 else /* give 'em the same float back */ | 613 else /* give 'em the same float back */ |
614 return arg; | 614 return arg; |
615 } | 615 } |
616 | 616 |
617 DEFUN ("logb", Flogb, Slogb, 1, 1, 0, | 617 DEFUN ("logb", Flogb, Slogb, 1, 1, 0, |
618 "Returns the integer that is the base 2 log of ARG.\n\ | 618 "Returns the integer not greater than the base 2 log of the magnitude of ARG.\n\ |
619 This is the same as the exponent of a float.") | 619 This is the same as the exponent of a float.") |
620 (arg) | 620 (arg) |
621 Lisp_Object arg; | 621 Lisp_Object arg; |
622 { | 622 { |
623 /* System V apparently doesn't have a `logb' function. It might be | 623 #ifdef USG |
624 better to use it on systems that have it, but Ultrix (at least) | 624 error ("SYSV apparently doesn't have a logb function; what to do?"); |
625 doesn't declare it properly in <math.h>; does anyone really care? */ | 625 #else |
626 return Flog (arg, make_number (2)); | 626 Lisp_Object val; |
627 double f = extract_float (num); | |
628 | |
629 IN_FLOAT (val = logb (f), num); | |
630 XSET (val, Lisp_Int, val); | |
631 return val; | |
632 #endif | |
627 } | 633 } |
628 | 634 |
629 /* the rounding functions */ | 635 /* the rounding functions */ |
630 | 636 |
631 DEFUN ("ceiling", Fceiling, Sceiling, 1, 1, 0, | 637 DEFUN ("ceiling", Fceiling, Sceiling, 1, 1, 0, |