Anonymous user
Greedy algorithm for Egyptian fractions: Difference between revisions
Greedy algorithm for Egyptian fractions (view source)
Revision as of 15:05, 5 February 2018
, 6 years ago→{{header|Common Lisp}}
Line 46:
(egyption-fractions r y (cons q acc)))))
((= (numerator a) 1) (reverse (cons a acc)))
(t (let ((b (
(egyption-fractions (mod (- y) x) (* y b) (cons (/ b) acc)))))))
|