From 5256a270e782a0a5ac676adc4dbd907208fb4a86 Mon Sep 17 00:00:00 2001
From: toy <toy>
Date: Sun, 17 Aug 2003 16:31:10 +0000
Subject: [PATCH] FFLOOR bug from Paul Dietz on cmucl-imp:

(defun f (x) (declare (type (integer 0 100) x)) (ffloor x))

was not compiling.  FTRUNCATE-DERIVE-TYPE-QUOT didn't handle the case
where the result type was FLOAT, which implied that
NUMERIC-TYPE-FORMAT is NIL.
---
 compiler/srctran.lisp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler/srctran.lisp b/compiler/srctran.lisp
index a94cd63f7..c570f2ce2 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.125 2003/08/16 11:45:46 gerd Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.126 2003/08/17 16:31:10 toy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1612,8 +1612,11 @@
     (flet ((floatify-bound (x)
 	     ;; Don't have to deal with list-type bounds because the
 	     ;; truncate defoptimizer doesn't return list-type bounds.
+	     ;;
+	     ;; Also, if RES-FORMAT is NIL, that means we want a FLOAT
+	     ;; type.
 	     (if (numberp x)
-		 (coerce x res-format)
+		 (coerce x (or res-format 'float))
 		 x)))
       (make-numeric-type :class 'float
 			 :format res-format
-- 
GitLab