diff options
| author | Jay Belanger | 2010-04-06 20:43:23 -0500 |
|---|---|---|
| committer | Jay Belanger | 2010-04-06 20:43:23 -0500 |
| commit | cfd4160dba90f61c9e2c311e0ac79b6ee988fb2e (patch) | |
| tree | f5f9baf6a8c4482f6f533969a18d64ed195f3473 | |
| parent | 317a26be001283988504d544692930af75a92e53 (diff) | |
| download | emacs-cfd4160dba90f61c9e2c311e0ac79b6ee988fb2e.tar.gz emacs-cfd4160dba90f61c9e2c311e0ac79b6ee988fb2e.zip | |
(calcFunc-fdiv): Use `nth' to choose elements from list.
| -rw-r--r-- | lisp/calc/calc-frac.el | 10 |
1 files 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 @@ | |||
| 214 | (math-reject-arg a "*Division by zero") | 214 | (math-reject-arg a "*Division by zero") |
| 215 | (math-make-frac (math-trunc a) (math-trunc b)))) | 215 | (math-make-frac (math-trunc a) (math-trunc b)))) |
| 216 | ((eq (car-safe b) 'frac) | 216 | ((eq (car-safe b) 'frac) |
| 217 | (if (Math-zerop (cadr b)) | 217 | (if (Math-zerop (nth 1 b)) |
| 218 | (math-reject-arg a "*Division by zero") | 218 | (math-reject-arg a "*Division by zero") |
| 219 | (math-make-frac (math-mul (math-trunc a) (caddr b)) (cadr b)))) | 219 | (math-make-frac (math-mul (math-trunc a) (nth 2 b)) (nth 1 b)))) |
| 220 | (t (math-reject-arg b 'integerp)))) | 220 | (t (math-reject-arg b 'integerp)))) |
| 221 | ((eq (car-safe a) 'frac) | 221 | ((eq (car-safe a) 'frac) |
| 222 | (cond | 222 | (cond |
| 223 | ((Math-num-integerp b) | 223 | ((Math-num-integerp b) |
| 224 | (if (Math-zerop b) | 224 | (if (Math-zerop b) |
| 225 | (math-reject-arg a "*Division by zero") | 225 | (math-reject-arg a "*Division by zero") |
| 226 | (math-make-frac (cadr a) (math-mul (caddr a) (math-trunc b))))) | 226 | (math-make-frac (cadr a) (math-mul (nth 2 a) (math-trunc b))))) |
| 227 | ((eq (car-safe b) 'frac) | 227 | ((eq (car-safe b) 'frac) |
| 228 | (if (Math-zerop (cadr b)) | 228 | (if (Math-zerop (nth 1 b)) |
| 229 | (math-reject-arg a "*Division by zero") | 229 | (math-reject-arg a "*Division by zero") |
| 230 | (math-make-frac (math-mul (cadr a) (caddr b)) (math-mul (caddr a) (cadr b))))) | 230 | (math-make-frac (math-mul (nth 1 a) (nth 2 b)) (math-mul (nth 2 a) (nth 1 b))))) |
| 231 | (t (math-reject-arg b 'integerp)))) | 231 | (t (math-reject-arg b 'integerp)))) |
| 232 | (t | 232 | (t |
| 233 | (math-reject-arg a 'integerp)))) | 233 | (math-reject-arg a 'integerp)))) |