]> git.eshelyaron.com Git - emacs.git/commitdiff
(calcFunc-fdiv): Use `nth' to choose elements from list.
authorJay Belanger <jay.p.belanger@gmail.com>
Wed, 7 Apr 2010 01:43:23 +0000 (20:43 -0500)
committerJay Belanger <jay.p.belanger@gmail.com>
Wed, 7 Apr 2010 01:43:23 +0000 (20:43 -0500)
lisp/calc/calc-frac.el

index d1164bec3c55ecf39b23670f1877d5aae509de51..265f0b325b9638c0fea07b8a196125c038084e8c 100644 (file)
          (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))))