Monday, May 22, 2006

EMI Computation in LISP


(defun emi(p r n)
  "
  p is the principle
  r is the annual rate of interest (as a fraction, 10% is 0.1)
  n is the number of instalments
  "
  (* p (/ r 12)
     (/ (expt (+ 1 (/ r 12))  n)
        (- (expt (+ 1 (/ r 12)) (- n 1)) 1))))

Example:
(emi 100000 0.15 36)

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home