From 5743edc2f64bb2dfd26242cacb3e3ca5634bf2cc Mon Sep 17 00:00:00 2001 From: dtc <dtc> Date: Thu, 18 Dec 1997 16:42:02 +0000 Subject: [PATCH] Enhance the sqrt derive-type optimize to return (0.0) rather than 0.0 if the argument is (0.0). --- compiler/float-tran.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/float-tran.lisp b/compiler/float-tran.lisp index 32c5b0e1c..86b7e8a8c 100644 --- a/compiler/float-tran.lisp +++ b/compiler/float-tran.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.53 1997/12/17 15:07:50 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.54 1997/12/18 16:42:02 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -684,8 +684,9 @@ (make-numeric-type :class 'float :format f-type - :low (or (and (> lo-val 0) (bound-func #'sqrt lo)) - (coerce 0 f-type)) + :low (cond ((> lo-val 0) (bound-func #'sqrt lo)) + ((consp lo) (list (coerce 0 f-type))) + (t (coerce 0 f-type))) :high (bound-func #'sqrt hi))) (float-or-complex-type arg)))) (t -- GitLab