[New-bugs-announce] [issue35637] Factorial should be able to evaluate float arguments

Yash Aggarwal report at bugs.python.org
Wed Jan 2 06:14:25 EST 2019

New submission from Yash Aggarwal <aggarwal.yash2011 at gmail.com>:

Factorial as of now accepts only integers or integral floats. 
I want to suggest extending the definition of float to accept all positive real numbers to be more consistent with general definition of factorial that uses gamma function.

What I am proposing is:
1. for integer value, the function should work as it does and return integer result.

2. for float input, both integer and non-integer valued, the returned value should be a floating point number.

3. the input domain should be extended to all real numbers except negative integers.

Such generalized function would feel more mathematically consistent.

components: Library (Lib)
messages: 332862
priority: normal
severity: normal
status: open
title: Factorial should be able to evaluate float arguments
type: enhancement
versions: Python 3.8

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list