mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-15 09:20:23 -07:00
Fix for type propagation of EXPT
This commit is contained in:
parent
a3726a2ecc
commit
aaf55b6a46
1 changed files with 9 additions and 7 deletions
|
|
@ -222,13 +222,15 @@
|
|||
;; (expt number-type integer) -> number-type
|
||||
;; (expt number-type1 number-type2) -> (max-float number-type1 number-type2)
|
||||
;;
|
||||
(multiple-value-bind (simplified-exponent exponent)
|
||||
(ensure-real-type exponent)
|
||||
(unless (eql simplified-exponent 'integer)
|
||||
(setf simplified-exponent (ensure-nonrational-type simplified-exponent)))
|
||||
(multiple-value-bind (result-type base aux)
|
||||
(maximum-number-type base simplified-exponent)
|
||||
(values (list base exponent) result-type))))
|
||||
(let ((exponent (ensure-real-type exponent)))
|
||||
(values (list base exponent)
|
||||
(cond ((eql exponent 'integer)
|
||||
base)
|
||||
((type>= '(real 0 *) base)
|
||||
(let* ((exponent (ensure-nonrational-type exponent)))
|
||||
(maximum-number-type exponent base)))
|
||||
(t
|
||||
'number)))))
|
||||
|
||||
(def-type-propagator abs (fname arg)
|
||||
(multiple-value-bind (output arg)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue