Terry Reedy wrote:

> 
> "Daniel 'Dang' Griffith" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> But the factorial example on the wiki has a defect.  It incorrectly
>> calculates factorial(0) as 0, when it should be 1.
> 
> This is a matter of definition, and definitions apparently differ.  fact(0)
> == 0 is a backward projection from the definition f(1) = f(2) = 1 in
> 1-based systems, which is the context for the rabbit problem in which the
> first year is year 1, not year 0.  Disagreement is not defect.

No, fact(0)==1 simply because any proper definition of a factorial has to match
up with the gamma function (offset by one) at all non-negative integers.  So
there's no room for any ambiguity here.

Regards,

f

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to