Continued fraction: Difference between revisions
→{{header|Perl 6}}: simplification + neglecting extra credit
(→{{header|Ada}}: -- revised solution using a (generic) package, to become more Ada-typical) |
(→{{header|Perl 6}}: simplification + neglecting extra credit) |
||
Line 737:
<lang Perl 6>sub infix:<⚬>(&f, &g) { -> $x { &f(&g($x)) } }
sub continued-fraction(@a, @b) {
map { $_(Inf) }, [\⚬]
}
Line 745:
The main advantage is that the definition of the function does not need to know for which rank n it is computed. This is arguably closer to the mathematical definition.
=={{header|PL/I}}==
|