[Python-ideas] Re: A better math.factorial

2021-09-17 Thread Serhiy Storchaka
17.09.21 05:23, Steven D'Aprano пише: factorial(23) == better_factorial(23) > False > > The problem is that since floats only have about 17 significant figures > or so, once you get to 23! the gamma function doesn't have enough > precision to give an exact answer. Of course that's easily fi

[Python-ideas] Re: A better math.factorial

2021-09-17 Thread Oscar Benjamin
On Thu, 16 Sept 2021 at 19:34, Jonatan wrote: > Currently, math.factorial only supports integers and not floats, whereas > the "mathematical" version supports both integers and floats. > I.e: > ``` > import math > > > def better_factorial(n): > return n * math.gamma(n) > > print(math.factoria

[Python-ideas] Re: A better math.factorial

2021-09-17 Thread Steven D'Aprano
On Fri, Sep 17, 2021 at 11:12:45AM +0300, Serhiy Storchaka wrote: > 17.09.21 05:23, Steven D'Aprano пише: > factorial(23) == better_factorial(23) > > False > > > > The problem is that since floats only have about 17 significant figures > > or so, once you get to 23! the gamma function doesn'

[Python-ideas] New feature to revert 'barry_as_FLUFL' future import

2021-09-17 Thread Jeremiah Vivian
NEW_FEATURE = "remove_barry_from_BDFL" or "barry_resign_as_FLUFL"/"barry_resign_as_BDFL"; Add a new future import NEW_FEATURE. This reverts the effects of the future import "barry_as_FLUFL" easter egg IF it is ever imported. This is absolutely unnecessary when "barry_as_FLUFL" isn't imported.

[Python-ideas] Re: New feature to revert 'barry_as_FLUFL' future import

2021-09-17 Thread Steven D'Aprano
barry_as_FLUFL is a joke, not a serious feature. Why do you want to enable it, then remove it? What's your motivation for this feature? -- Steve ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to python-ideas-le.

[Python-ideas] Re: New feature to revert 'barry_as_FLUFL' future import

2021-09-17 Thread David Mertz, Ph.D.
This feature request comes about 196 days to early. It is perhaps worth considering on April 1, but not in September. On Fri, Sep 17, 2021 at 8:59 AM Jeremiah Vivian < [email protected]> wrote: > NEW_FEATURE = "remove_barry_from_BDFL" or > "barry_resign_as_FLUFL"/"barry_resign_as_BDFL

[Python-ideas] Re: A better math.factorial

2021-09-17 Thread Stephen J. Turnbull
Steven D'Aprano writes: > But I don't think it would be a big problem unless the caller was mixing > calls to gamma with int and float arguments. You mean `factorial` here, right? `gamma` coerces int to float before evaluating, doesn't it? > If you stick to one or the other, it wouldn't mat

[Python-ideas] Re: New feature to revert 'barry_as_FLUFL' future import

2021-09-17 Thread Stephen J. Turnbull
David Mertz, Ph.D. writes: > This feature request comes about 196 days to early. +195 (from Japan ;-) ___ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailm

[Python-ideas] Re: A better math.factorial

2021-09-17 Thread Steven D'Aprano
On Sat, Sep 18, 2021 at 11:24:40AM +0900, Stephen J. Turnbull wrote: > Steven D'Aprano writes: > > > But I don't think it would be a big problem unless the caller was mixing > > calls to gamma with int and float arguments. > > You mean `factorial` here, right? `gamma` coerces int to float bef