mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 02:31:03 -08:00
(calcFunc-fdiv): Use `nth' to choose elements from list.
This commit is contained in:
parent
317a26be00
commit
cfd4160dba
1 changed files with 5 additions and 5 deletions
|
|
@ -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))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue