where it can be found.
3. If you like, you can tweak the *FEATURES* set for the resulting
Lisp system, enabling or disabling features like documentation
- strings or extra debugging code. The preferred way to do this is
- by creating a file "customize-target-features.lisp", containing
- a lambda expression which is applied to the default *FEATURES*
- set and which returns the new *FEATURES* set, e.g.
+ strings, threads, or extra debugging code (see
+ "base-target-features.lisp-expr" for a list of recognized
+ *FEATURES*). The preferred way to do this is by creating a file
+ "customize-target-features.lisp", containing a lambda expression
+ which is applied to the default *FEATURES* set and which returns
+ the new *FEATURES* set, e.g.
(LAMBDA (LIST)
(ADJOIN :SB-SHOW
(REMOVE :SB-DOC
((csubtypep y (specifier-type 'integer))
;; A real raised to an integer power is well-defined.
(merged-interval-expt x y))
+ ;; A real raised to a non-integral power can be a float or a
+ ;; complex number.
+ ((or (csubtypep x (specifier-type '(rational 0)))
+ (csubtypep x (specifier-type '(float (0d0)))))
+ ;; But a positive real to any power is well-defined.
+ (merged-interval-expt x y))
+ ((and (csubtypep x (specifier-type 'rational))
+ (csubtypep x (specifier-type 'rational)))
+ ;; A rational to the power of a rational could be a rational
+ ;; or a possibly-complex single float
+ (specifier-type '(or rational single-float (complex single-float))))
(t
- ;; A real raised to a non-integral power can be a float or a
- ;; complex number.
- (cond ((or (csubtypep x (specifier-type '(rational 0)))
- (csubtypep x (specifier-type '(float (0d0)))))
- ;; But a positive real to any power is well-defined.
- (merged-interval-expt x y))
- (t
- ;; a real to some power. The result could be a real
- ;; or a complex.
- (float-or-complex-float-type (numeric-contagion x y)))))))
+ ;; a real to some power. The result could be a real or a
+ ;; complex.
+ (float-or-complex-float-type (numeric-contagion x y)))))
(defoptimizer (expt derive-type) ((x y))
(two-arg-derive-type x y #'expt-derive-type-aux #'expt))
{
printf(
"This is SBCL %s, an implementation of ANSI Common Lisp.\n\
+\n\
More information about SBCL is available at <http://www.sbcl.org/>.\
\n\
SBCL is free software, provided as is, with absolutely no warranty.\n\
(load source)
(full-check)
(delete-file fasl)))
-
+\f
+(defun expt-derive-type-bug (a b)
+ (unless (< a b)
+ (truncate (expt a b))))
+(assert (equal (multiple-value-list (expt-derive-type-bug 1 1))
+ '(1 0)))
\f
;;;; tests not in the problem domain, but of the consistency of the
;;;; compiler machinery itself
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.6.27"
+"0.8.6.28"