Greedy algorithm for Egyptian fractions: Difference between revisions
Content added Content deleted
(→{{header|Python}}: Added a functionally composed version.) |
(→Composition of pure functions: Edited derivation of negative ratios) |
||
Line 1,596: | Line 1,596: | ||
)) if n else Nothing() |
)) if n else Nothing() |
||
fr = Fraction |
fr = Fraction |
||
return list( |
|||
map(neg, unfoldr(go)(-nd)) |
|||
) if 0 > nd else unfoldr(go)(nd) |
|||