changeset 107792:84df551e8c64

(calcFunc-fdiv): Use `nth' to choose elements from list.
author Jay Belanger <jay.p.belanger@gmail.com>
date Tue, 06 Apr 2010 20:43:23 -0500
parents 439c9c198a6b
children d3738a1728c6
files lisp/calc/calc-frac.el
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calc-frac.el	Tue Apr 06 20:33:00 2010 -0500
+++ b/lisp/calc/calc-frac.el	Tue Apr 06 20:43:23 2010 -0500
@@ -214,20 +214,20 @@
 	  (math-reject-arg a "*Division by zero")
 	(math-make-frac (math-trunc a) (math-trunc b))))
      ((eq (car-safe b) 'frac)
-      (if (Math-zerop (cadr b))
+      (if (Math-zerop (nth 1 b))
 	  (math-reject-arg a "*Division by zero")
-	(math-make-frac (math-mul (math-trunc a) (caddr b)) (cadr b))))
+	(math-make-frac (math-mul (math-trunc a) (nth 2 b)) (nth 1 b))))
      (t (math-reject-arg b 'integerp))))
    ((eq (car-safe a) 'frac)
     (cond 
      ((Math-num-integerp b)
       (if (Math-zerop b)
 	  (math-reject-arg a "*Division by zero")
-	(math-make-frac (cadr a) (math-mul (caddr a) (math-trunc b)))))
+	(math-make-frac (cadr a) (math-mul (nth 2 a) (math-trunc b)))))
      ((eq (car-safe b) 'frac)
-      (if (Math-zerop (cadr b))
+      (if (Math-zerop (nth 1 b))
 	  (math-reject-arg a "*Division by zero")
-	(math-make-frac (math-mul (cadr a) (caddr b)) (math-mul (caddr a) (cadr b)))))
+	(math-make-frac (math-mul (nth 1 a) (nth 2 b)) (math-mul (nth 2 a) (nth 1 b)))))
      (t (math-reject-arg b 'integerp))))
    (t 
     (math-reject-arg a 'integerp))))