JMRyan <[email protected]> wrote:

Andrei Alexandrescu <[email protected]> wrote in news:hg0d2f
[email protected]:

Love the Stob. The factorial joke on page 3 is really funny :o).

As funny as the factorial joke is, it doesn't work because infinity - 1 =
infinity (for the same reason infinity! = infinity).

JMRyan

There are plenty of reasons it doesn't work. Now see, it's not supposed
to - it's a critique of the age-old recursive factorial which we all see
far too often. I'd go with the recursive Fibonacci myself:

fib( inf ) -> inf;
fib( N ) -> fib( N + 2 ) - fib( N + 1 );

Now, with N being a bigint, this might take even longer than the common
recursive fib - but not so much that we care.

--
Simen

Reply via email to