News for hackers. Stuff that matters.
Re:The Evolution of a Python Programmer by tomku on Thursday March 08, 2012 @02:55PM (#3681293)
The factorial itself is only defined for non-negative integers. This may seem pedantic, but what you've defined there is actually Gauss's pi function, which has many interesting mathematical properties, but is not equivalent to the factorial because it has a larger domain. The results that it gives for non-integer arguments aren't any more "correct" than a factorial function throwing an exception, because they're both behaving appropriately for their defined domain.

Edit: The math module has a factorial() function anyways, so it's a bit of a moot point. Use that :)

Edit Edit: Thanks for the catch, I did mean non-negative integers instead of positive.

Re:The Evolution of a Python Programmer by JeanPierre on Thursday March 08, 2012 @02:59PM (#3681304)
As far as I know, 0! = 1, so I assume you meant non-negative integers instead of positive integers?