Commit 44969014 authored by Liam M. Healy's avatar Liam M. Healy
Browse files

Add return-zero restart for expt, define #'radian to find angle in radians

parent 26220c37
;; Generic functions for generalized numbers
;; Liam Healy Tue Feb 9 1999 - 21:38
;; Time-stamp: <2013-11-27 10:36:44EST generic.lisp>
;; Time-stamp: <2013-12-16 17:25:39EST generic.lisp>
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -231,6 +231,7 @@
(signum den)
den))))))
(export 'return-zero)
(defgeneric expt (num exponent)
(:documentation "Raise the number to the exponent.")
(:method ((num number) (exponent number))
......@@ -244,7 +245,10 @@
(accept () :report "Accept complex answer.")
(absolute-value ()
:report "Take the absolute value of the argument and return a real."
(setq num (abs num)))))
(setq num (abs num)))
(return-zero ()
:report "Return zero."
(return-from expt 0.0))))
(cl:expt num exponent)))
(defgeneric exp (num)
......
;; Functions on angles
;; Liam Healy Fri Mar 26 1999 - 13:48
;; Time-stamp: <2013-03-24 19:22:39EDT angle.lisp>
;; Time-stamp: <2013-12-16 17:48:14EST angle.lisp>
;; Copyright 2011, 2013 Liam M. Healy
;; Distributed under the terms of the GNU General Public License
......@@ -20,9 +20,17 @@
(in-package :antik)
(export '(norm-denorm-angle angle-as-time dms-angle time-as-angle angle-dms write-dms))
;;;;****************************************************************************
;;;; Basic angle definitions
;;;;****************************************************************************
(setf *radian* (make-pq 1 'radian))
(export '(norm-denorm-angle angle-as-time dms-angle time-as-angle angle-dms write-dms))
(defun radian (angle)
"The numerical value of the angle in radians."
(antik::pq-magnitude angle))
;;; This will be obsolete
(defun norm-denorm-angle (angle function &optional positive)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment