From 7cc4661c010d4529f315d8996c235a21040e1295 Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Thu, 4 Dec 1997 03:58:31 +0000
Subject: [PATCH] Update upgraded-complex-part-type for complex-float support.

---
 code/numbers.lisp | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/code/numbers.lisp b/code/numbers.lisp
index 053f6f535..90f6ea53b 100644
--- a/code/numbers.lisp
+++ b/code/numbers.lisp
@@ -5,11 +5,11 @@
 ;;; 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.31 1997/11/16 13:59:56 dtc Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/numbers.lisp,v 1.32 1997/12/04 03:58:31 dtc Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
-;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/numbers.lisp,v 1.31 1997/11/16 13:59:56 dtc Exp $
+;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/numbers.lisp,v 1.32 1997/12/04 03:58:31 dtc Exp $
 ;;;
 ;;; This file contains the definitions of most number functions.
 ;;;
@@ -257,12 +257,25 @@
 
 ;;;; Complexes:
 
+#-complex-float
 (defun upgraded-complex-part-type (spec)
   "Returns the element type of the most specialized COMPLEX number type that
    can hold parts of type Spec.  This is currently always T."
   (declare (ignore spec))
   t)
 
+#+complex-float
+(defun upgraded-complex-part-type (spec)
+  "Returns the element type of the most specialized COMPLEX number type that
+   can hold parts of type Spec."
+  (cond ((subtypep spec 'single-float)
+	 'single-float)
+	((subtypep spec 'double-float)
+	 'double-float)
+	((subtypep spec 'rational)
+	 'rational)
+	(t)))
+
 #-complex-float
 (defun complex (realpart &optional (imagpart 0))
   "Builds a complex number from the specified components."
-- 
GitLab