Changeset 3711


Ignore:
Timestamp:
09/11/03 16:32:32 (19 years ago)
Author:
piso
Message:

CONJUGATE

File:
1 edited

Legend:

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

    r3645 r3711  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: numbers.lisp,v 1.13 2003-09-10 01:22:57 piso Exp $
     4;;; $Id: numbers.lisp,v 1.14 2003-09-11 16:32:32 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    161161  (rational x))
    162162
    163 
    164163(defun gcd (&rest numbers)
    165164  "Returns the greatest common divisor of the arguments, which must be
     
    174173        (rest (cdr numbers) (cdr rest)))
    175174       ((null rest) gcd)))))
    176 
    177175
    178176;;; From discussion on comp.lang.lisp and Akira Kurihara.
     
    209207     (abs float2)))
    210208
     209(defun conjugate (number)
     210  (etypecase number
     211    (complex
     212     (complex (realpart number) (- (imagpart number))))
     213    (number
     214     number)))
    211215
    212216(defun phase (number)
     
    231235              (atan (imagpart number) (realpart number)))))
    232236
    233 
    234237(when (and (find-package "JVM")
    235238           (fboundp 'jvm::jvm-compile))
Note: See TracChangeset for help on using the changeset viewer.