From f5c03a9638b63f2ab96f9cd1dc4323264215519c Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Sun, 12 Jul 2009 23:46:45 +0200 Subject: [PATCH] Fixed a couple of typos in the new type propagations for special functions --- src/cmp/cmpnum.lsp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/cmp/cmpnum.lsp b/src/cmp/cmpnum.lsp index 291c8b1da..aaa69d9f2 100644 --- a/src/cmp/cmpnum.lsp +++ b/src/cmp/cmpnum.lsp @@ -157,33 +157,33 @@ (unless (eql simplified-exponent 'integer) (setf simplified-exponent (ensure-nonrational-type simplified-exponent))) (multiple-value-bind (result-type base aux) - (maximum-number-type result-type base simplified-exponent) + (maximum-number-type base simplified-exponent) (values (list base exponent) result-type)))) (def-type-propagator abs (fname arg) (multiple-value-bind (output arg) (ensure-number-type arg) (values (list arg) - (or (getf '((FIXNUM (INTEGER 0 #.MOST-POSITIVE-FIXNUM)) - (INTEGER (INTEGER 0 *)) - (RATIONAL (RATIONAL 0 *)) - (SHORT-FLOAT (SHORT-FLOAT 0 *)) - (SINGLE-FLOAT (SINGLE-FLOAT 0 *)) - (DOUBLE-FLOAT (DOUBLE-FLOAT 0 *)) - (LONG-FLOAT (LONG-FLOAT 0 *)) - (REAL (REAL 0 *)) - (NUMBER (REAL 0 *))) - output) + (or (cdr (assoc output + '((FIXNUM . (INTEGER 0 #.MOST-POSITIVE-FIXNUM)) + (INTEGER . (INTEGER 0 *)) + (RATIONAL . (RATIONAL 0 *)) + (SHORT-FLOAT . (SHORT-FLOAT 0 *)) + (SINGLE-FLOAT . (SINGLE-FLOAT 0 *)) + (DOUBLE-FLOAT . (DOUBLE-FLOAT 0 *)) + (LONG-FLOAT . (LONG-FLOAT 0 *)) + (REAL . (REAL 0 *)) + (NUMBER . (REAL 0 *))))) output)))) (def-type-propagator sqrt (fname arg) (multiple-value-bind (output arg) (ensure-nonrational-type arg) (values (list arg) - (if (type<= arg '(REAL 0 *)) output 'NUMBER)))) + (if (type>= '(REAL 0 *) arg) output 'NUMBER)))) (def-type-propagator isqrt (fname arg) - (if (type<= arg '#1=(integer 0 #.MOST-POSITIVE-FIXNUM)) + (if (type>= '#1=(integer 0 #.MOST-POSITIVE-FIXNUM) arg) (values '(#1#) #1#) (values '(#2=(integer 0 *)) #2#)))