source: branches/rme-fpe/level-0/l0-complex.lisp @ 15779

Last change on this file since 15779 was 13067, checked in by rme, 10 years ago

Update copyright notices.

  • 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) 2009 Clozure Associates
4;;;   Copyright (C) 1994-2001 Digitool, Inc
5;;;   This file is part of Clozure CL. 
6;;;
7;;;   Clozure CL is licensed under the terms of the Lisp Lesser GNU Public
8;;;   License , known as the LLGPL and distributed with Clozure CL as the
9;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
10;;;   which is distributed with Clozure CL as the file "LGPL".  Where these
11;;;   conflict, the preamble takes precedence. 
12;;;
13;;;   Clozure CL is referenced in the preamble as the "LIBRARY."
14;;;
15;;;   The LLGPL is also available online at
16;;;   http://opensource.franz.com/preamble.html
17
18(in-package "CCL")
19
20(eval-when (:compile-toplevel)
21  (require "NUMBER-MACROS"))
22
23(defun coerce-to-complex-type (num type)
24  (cond ((complexp num)
25         (let ((real (%realpart num))
26               (imag (%imagpart num)))
27           (if (and (typep real type)
28                    (typep imag type))
29             num
30             (complex (coerce real type)
31                      (coerce imag type)))))
32        (t (complex (coerce num type)))))
33
34;;; end of l0-complex.lisp
Note: See TracBrowser for help on using the repository browser.