This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author David Radcliffe
Recipients David Radcliffe, FR4NKESTI3N, josh.r, jwilk, kellerfuchs, mark.dickinson, pablogsal, rhettinger, serhiy.storchaka, steven.daprano, tim.peters
Date 2019-06-03.02:32:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAJ7c8CkRAEfDf+NjY7Jkh2Zdw9Bq_exdh5mrgDugE7H0a+b3Pg@mail.gmail.com>
In-reply-to <1559527193.76.0.127445663463.issue35431@roundup.psfhosted.org>
Content
I understand that pure mathematics is not the primary use case. But I would
expect that math.comb() would be used to implement mathematical formulas.
As a simple example, the number of edges in a complete graph on n vertices
is binomial(n, 2), and this should be valid if n < 2. Polynomial
interpolation is another problem where this can occur. However, I do agree
that binomial coefficients with negative arguments are relatively
unimportant.

On Sun, Jun 2, 2019 at 8:59 PM Raymond Hettinger <report@bugs.python.org>
wrote:

>
> Raymond Hettinger <raymond.hettinger@gmail.com> added the comment:
>
> Here are a few other data points.  There is no consensus but either
> returning 0 or erroring out seem reasonable.
>
> MS Excel's COMBIN: If number < 0, number_chosen < 0, or number <
> number_chosen, COMBIN returns the #NUM! error value.
>
> Scipy.misc.comb: If k > N, N < 0, or k < 0, then a 0 is returned.
>
> Matlib.nchoose: Error: K must an integer between 0 and N.
>
> Maple.numbcomb: Unclear from the docs what this does
>
> Wolfram alpha:  Returns 0
> https://www.wolframalpha.com/input/?i=10+choose+12
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue35431>
> _______________________________________
>
History
Date User Action Args
2019-06-03 02:32:22David Radcliffesetrecipients: + David Radcliffe, tim.peters, rhettinger, mark.dickinson, jwilk, steven.daprano, serhiy.storchaka, josh.r, pablogsal, kellerfuchs, FR4NKESTI3N
2019-06-03 02:32:22David Radcliffelinkissue35431 messages
2019-06-03 02:32:22David Radcliffecreate