source: trunk/source/level-0/l0-complex.lisp @ 15601

Last change on this file since 15601 was 13067, checked in by rme, 11 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
RevLine 
[6]1;;;-*- Mode: Lisp; Package: CCL -*-
2;;;
[13067]3;;;   Copyright (C) 2009 Clozure Associates
[6]4;;;   Copyright (C) 1994-2001 Digitool, Inc
[13066]5;;;   This file is part of Clozure CL. 
[6]6;;;
[13066]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
[6]9;;;   file "LICENSE".  The LLGPL consists of a preamble and the LGPL,
[13066]10;;;   which is distributed with Clozure CL as the file "LGPL".  Where these
[6]11;;;   conflict, the preamble takes precedence. 
12;;;
[13066]13;;;   Clozure CL is referenced in the preamble as the "LIBRARY."
[6]14;;;
15;;;   The LLGPL is also available online at
16;;;   http://opensource.franz.com/preamble.html
17
[1937]18(in-package "CCL")
19
[581]20(eval-when (:compile-toplevel)
21  (require "NUMBER-MACROS"))
22
[6]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
[1937]34;;; end of l0-complex.lisp
Note: See TracBrowser for help on using the repository browser.