|
|
|
|
|
by tomku
5210 days ago
|
|
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. |
|