Added support for LOG function.
authorTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 22:46:13 +0000 (22:46 +0000)
committerTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 22:46:13 +0000 (22:46 +0000)
Thanks to: Daniel Gackle <danielgackle@gmail.com>

src/lib/ps-macro-lib.lisp
src/package.lisp

index 81c56e3..553ce0a 100644 (file)
     (asin (n) `(*math.asin ,n))
     (atan (y &optional x) (if x `(*math.atan2 ,y ,x) `(*math.atan ,y)))
     (exp (n) `(*math.exp ,n))
+    (log (n &optional base)
+      (or (and (null base) `(*math.log ,n))
+          (and (numberp base) (= base 10) `(* (log ,n) *math.*log10e*))
+          `(/ (log ,n) (log ,base))))
     (floor (n &optional divisor) `(*math.floor ,(if divisor `(/ ,n ,divisor) n)))
     (expt (base power) `(*math.pow ,base ,power))
     (round (n &optional divisor) `(*math.round ,(if divisor `(/ ,n ,divisor) n)))
index 779fc4d..358b571 100644 (file)
       #:asin
       #:atan
       #:exp
+      #:log
       #:floor
       #:expt
       #:round