D gets a mention by Verity Stob

Simen kjaeraas simen.kjaras at gmail.com
Sun Dec 13 15:56:38 PST 2009


JMRyan <nospam at nospam.com> wrote:

> Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote in news:hg0d2f
> $26jv$1 at digitalmars.com:
>>
>> 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



More information about the Digitalmars-d mailing list