projects
/
kmrcl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r5584: *** empty log message ***
[kmrcl.git]
/
math.lisp
diff --git
a/math.lisp
b/math.lisp
index 9772b7a52df849bfee3b40b4eebb4f5a6162c541..682cd74027776f7dfc5a3d4346c7a0ab2be55f50 100644
(file)
--- a/
math.lisp
+++ b/
math.lisp
@@
-7,7
+7,7
@@
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Nov 2002
;;;;
;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Nov 2002
;;;;
-;;;; $Id: math.lisp,v 1.
1 2002/11/08 06:43:34
kevin Exp $
+;;;; $Id: math.lisp,v 1.
4 2003/06/06 21:59:29
kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
@@
-17,8
+17,7
@@
;;;; *************************************************************************
;;;; *************************************************************************
-(in-package :kmrcl)
-(declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3)))
+(in-package #:kmrcl)
(defun deriv (f dx)
#'(lambda (x)
(defun deriv (f dx)
#'(lambda (x)
@@
-29,3
+28,9
@@
(funcall (deriv #'sin 1d-8) x))
;;; (sin^ pi)
(funcall (deriv #'sin 1d-8) x))
;;; (sin^ pi)
+
+(defmacro ensure-integer (obj)
+ "Ensure object is an integer. If it is a string, then parse it"
+ `(if (stringp ,obj)
+ (parse-integer ,obj)
+ ,obj))