source: branches/working-0711/ccl/level-0/l0-complex.lisp @ 7620

Last change on this file since 7620 was 1937, checked in by gb, 15 years ago

Add (IN-PACKAGE "CCL").

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1;;;-*- Mode: Lisp; Package: CCL -*-
2;;;
3;;;   Copyright (C) 1994-2001 Digitool, Inc
4;;;   This file is part of OpenMCL. 
5;;;
6;;;   OpenMCL is licensed under the terms of the Lisp Lesser GNU Public
7;;;   License , known as the LLGPL and distributed with OpenMCL as the
8;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
9;;;   which is distributed with OpenMCL as the file "LGPL".  Where these
10;;;   conflict, the preamble takes precedence. 
11;;;
12;;;   OpenMCL is referenced in the preamble as the "LIBRARY."
13;;;
14;;;   The LLGPL is also available online at
15;;;   http://opensource.franz.com/preamble.html
16
17(in-package "CCL")
18
19(eval-when (:compile-toplevel)
20  (require "NUMBER-MACROS"))
21
22(defun coerce-to-complex-type (num type)
23  (cond ((complexp num)
24         (let ((real (%realpart num))
25               (imag (%imagpart num)))
26           (if (and (typep real type)
27                    (typep imag type))
28             num
29             (complex (coerce real type)
30                      (coerce imag type)))))
31        (t (complex (coerce num type)))))
32
33;;; end of l0-complex.lisp
Note: See TracBrowser for help on using the repository browser.