Greedy algorithm for Egyptian fractions: Difference between revisions

Line 46:
(egyption-fractions r y (cons q acc)))))
((= (numerator a) 1) (reverse (cons a acc)))
(t (let ((b (1+ (floorceiling y x))))
(egyption-fractions (mod (- y) x) (* y b) (cons (/ b) acc)))))))
 
Anonymous user