Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
cfd4160d
Commit
cfd4160d
authored
Apr 06, 2010
by
Jay Belanger
Browse files
(calcFunc-fdiv): Use `nth' to choose elements from list.
parent
317a26be
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
lisp/calc/calc-frac.el
lisp/calc/calc-frac.el
+5
-5
No files found.
lisp/calc/calc-frac.el
View file @
cfd4160d
...
...
@@ -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
))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment