From cfd4160dba90f61c9e2c311e0ac79b6ee988fb2e Mon Sep 17 00:00:00 2001 From: Jay Belanger Date: Tue, 6 Apr 2010 20:43:23 -0500 Subject: [PATCH] (calcFunc-fdiv): Use `nth' to choose elements from list. --- lisp/calc/calc-frac.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/calc/calc-frac.el b/lisp/calc/calc-frac.el index d1164bec3c5..265f0b325b9 100644 --- a/lisp/calc/calc-frac.el +++ b/lisp/calc/calc-frac.el @@ -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)))) -- 2.11.4.GIT