Issue35637
Created on 2019-01-02 11:14 by FR4NKESTI3N, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg332862 - (view) | Author: Yash Aggarwal (FR4NKESTI3N) * | Date: 2019-01-02 11:14 | |
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. |
|||
| msg332869 - (view) | Author: Mark Dickinson (mark.dickinson) * ![]() |
Date: 2019-01-02 12:43 | |
See related discussion in issue #33083. Are you aware that `math.gamma` and `math.lgamma` exist? These already provide the ability to compute the "factorial" of a non-integral input. I'd be opposed to extending math.factorial to accept non-integral floats. |
|||
| msg332870 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2019-01-02 12:45 | |
I concur with Mark. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:09 | admin | set | github: 79818 |
| 2019-01-02 12:45:13 | serhiy.storchaka | set | status: open -> closed nosy:
+ serhiy.storchaka resolution: rejected |
| 2019-01-02 12:43:20 | mark.dickinson | set | nosy:
+ mark.dickinson messages: + msg332869 |
| 2019-01-02 11:14:25 | FR4NKESTI3N | create | |
