From 2b8606b77073300c58195e7395771be33ae335d3 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Tue, 15 Apr 2008 15:34:34 +0000
Subject: [PATCH] When SCALE-FLOAT would underflow, return a floating-point 0
 of the same type as the float argument.  (Previously was just returning 0f0.)

---
 code/float.lisp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/code/float.lisp b/code/float.lisp
index 0a17dbf93..7b3877365 100644
--- a/code/float.lisp
+++ b/code/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/code/float.lisp,v 1.39 2008/02/13 15:03:38 rtoy Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/float.lisp,v 1.40 2008/04/15 15:34:34 rtoy Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -828,7 +828,9 @@
 		 :operands (list x exp)))
 	(let ((shift (1- new-exp)))
 	  (if (< shift (- (1- digits)))
-	      (float-sign x 0.0)
+	      (etypecase x
+		(single-float (float-sign x 0f0))
+		(double-float (float-sign x 0d0)))
 	      (etypecase x
 		(single-float (single-from-bits sign 0 (ash sig shift)))
 		(double-float (double-from-bits sign 0 (ash sig shift)))))))
-- 
GitLab