0.6.11.17:
[sbcl.git] / src / code / target-numbers.lisp
index c10c22e..8cc52ab 100644 (file)
                    (error 'simple-type-error :datum ,var
                           :expected-type ',type
                           :format-control
-                          "Argument ~A is not a ~S: ~S."
+                          "~@<Argument ~A is not a ~S: ~2I~_~S~:>"
                           :format-arguments
                           (list ',var ',type ,var))))))
 
 (defun upgraded-complex-part-type (spec)
   #!+sb-doc
   "Returns the element type of the most specialized COMPLEX number type that
-   can hold parts of type Spec."
-  (cond ((subtypep spec 'single-float)
+   can hold parts of type SPEC."
+  (cond ((unknown-type-p (specifier-type spec))
+        (error "undefined type: ~S" spec))
+       ((subtypep spec 'single-float)
         'single-float)
        ((subtypep spec 'double-float)
         'double-float)
         'long-float)
        ((subtypep spec 'rational)
         'rational)
-       (t)))
+       (t
+        'real)))
 
 (defun complex (realpart &optional (imagpart 0))
   #!+sb-doc
   "Returns the root of the nearest integer less than n which is a perfect
    square."
   (declare (type unsigned-byte n) (values unsigned-byte))
-  ;; theoretically (> n 7), i.e., n-len-quarter > 0
+  ;; Theoretically (> n 7), i.e., n-len-quarter > 0.
   (if (and (fixnump n) (<= n 24))
       (cond ((> n 15) 4)
            ((> n  8) 3)