From 115b40865fab6be7c614b0c8940676caa799d08a Mon Sep 17 00:00:00 2001 From: toy <toy> Date: Mon, 7 Oct 2002 17:44:13 +0000 Subject: [PATCH] From Gerd Moelmann, with minor additions for sparc: o max/min should check that a real number is given, even for the single-arg case instead of just returning the arg. --- code/numbers.lisp | 6 +++--- compiler/sparc/float.lisp | 6 +++--- compiler/srctran.lisp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/code/numbers.lisp b/code/numbers.lisp index 314b9129c..f9d82828d 100644 --- a/code/numbers.lisp +++ b/code/numbers.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/code/numbers.lisp,v 1.44 2002/08/12 21:12:46 toy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/numbers.lisp,v 1.45 2002/10/07 17:44:12 toy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -875,7 +875,7 @@ (defun max (number &rest more-numbers) "Returns the greatest of its arguments." (do ((nlist more-numbers (cdr nlist)) - (result number)) + (result (the real number))) ((null nlist) (return result)) (declare (list nlist)) (if (> (car nlist) result) (setq result (car nlist))))) @@ -883,7 +883,7 @@ (defun min (number &rest more-numbers) "Returns the least of its arguments." (do ((nlist more-numbers (cdr nlist)) - (result number)) + (result (the real number))) ((null nlist) (return result)) (declare (list nlist)) (if (< (car nlist) result) (setq result (car nlist))))) diff --git a/compiler/sparc/float.lisp b/compiler/sparc/float.lisp index 8c3be0a49..98d5e26cc 100644 --- a/compiler/sparc/float.lisp +++ b/compiler/sparc/float.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/sparc/float.lisp,v 1.34 2002/03/08 18:38:21 toy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/float.lisp,v 1.35 2002/10/07 17:44:13 toy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -2553,13 +2553,13 @@ (def-source-transform min (&rest args) (case (length args) ((0 2) (values nil t)) - (1 `(values ,(first args))) + (1 `(values (the real ,(first args)))) (t (c::associate-arguments 'min (first args) (rest args))))) (def-source-transform max (&rest args) (case (length args) ((0 2) (values nil t)) - (1 `(values ,(first args))) + (1 `(values (the real ,(first args)))) (t (c::associate-arguments 'max (first args) (rest args))))) ;; Derive the types of max and min diff --git a/compiler/srctran.lisp b/compiler/srctran.lisp index 28226ccf4..979d4b70f 100644 --- a/compiler/srctran.lisp +++ b/compiler/srctran.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/srctran.lisp,v 1.112 2002/09/06 18:22:36 toy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.113 2002/10/07 17:44:12 toy Exp $") ;;; ;;; ********************************************************************** ;;; @@ -3223,7 +3223,7 @@ ;;; Expand Max and Min into the obvious comparisons. (def-source-transform max (arg &rest more-args) (if (null more-args) - `(values ,arg) + `(values (the real ,arg)) (once-only ((arg1 arg) (arg2 `(max ,@more-args))) `(if (> ,arg1 ,arg2) @@ -3231,7 +3231,7 @@ ;;; (def-source-transform min (arg &rest more-args) (if (null more-args) - `(values ,arg) + `(values (the real ,arg)) (once-only ((arg1 arg) (arg2 `(min ,@more-args))) `(if (< ,arg1 ,arg2) -- GitLab