Ignore:
Timestamp:
10/31/03 19:25:39 (19 years ago)
Author:
piso
Message:

CIS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/numbers.lisp

    r4549 r4590  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: numbers.lisp,v 1.16 2003-10-27 04:44:18 dmcnaught Exp $
     4;;; $Id: numbers.lisp,v 1.17 2003-10-31 19:25:17 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    239239                  (atan (imagpart number) (realpart number))))))
    240240
    241 (when (and (find-package "JVM")
    242            (fboundp 'jvm::jvm-compile))
     241(defun cis (theta)
     242  "Return cos(Theta) + i sin(Theta), AKA exp(i Theta)."
     243  (if (complexp theta)
     244      (error "argument to CIS is complex: ~S" theta)
     245      (complex (cos theta) (sin theta))))
     246
     247(when (fboundp 'jvm::jvm-compile)
    243248  (mapcar #'jvm::jvm-compile '(floor
    244249                               ceiling
Note: See TracChangeset for help on using the changeset viewer.