[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: Thanks @rhettinger for cleaning up the code and closing the pr. I didn't get what you meant by long, and sorry for not being much active as well. I am stuck with a pretty time consuming internship. -- versions: +Python 3.6 -Python 3.8 ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: Can I work on C implementation if no-one else is doing it right now? -- nosy: +FR4NKESTI3N ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: Thanks @mark.dickinson. As @rhettinger suggested, I'll write a basic function that uses division and works in O(k) for now. It's holiday season but hopefully @kellerfuchs will respond by then, and in the meantime I'll write more tests other than pascal's identity and corner cases. -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35637] Factorial should be able to evaluate float arguments
New submission from Yash Aggarwal : 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 nosy: FR4NKESTI3N priority: normal severity: normal status: open title: Factorial should be able to evaluate float arguments type: enhancement versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue35637> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35434] Wrong bpo linked in What's New in 3.8
Change by Yash Aggarwal : -- pull_requests: +10809 ___ Python tracker <https://bugs.python.org/issue35434> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35434] Wrong bpo linked in What's New in 3.8
Change by Yash Aggarwal : -- pull_requests: +10809, 10810 ___ Python tracker <https://bugs.python.org/issue35434> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35434] Wrong bpo linked in What's New in 3.8
Change by Yash Aggarwal : -- pull_requests: +10809, 10810, 10811 ___ Python tracker <https://bugs.python.org/issue35434> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Change by Yash Aggarwal : -- pull_requests: +10812 ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35434] Wrong bpo linked in What's New in 3.8
Change by Yash Aggarwal : -- pull_requests: -10809 ___ Python tracker <https://bugs.python.org/issue35434> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35434] Wrong bpo linked in What's New in 3.8
Change by Yash Aggarwal : -- pull_requests: -10811 ___ Python tracker <https://bugs.python.org/issue35434> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35434] Wrong bpo linked in What's New in 3.8
Change by Yash Aggarwal : -- pull_requests: -10810 ___ Python tracker <https://bugs.python.org/issue35434> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: I have written the function in the latest patch to work only for positive n. Although the definition of combination or nChoosek makes no sense for negative n, negative binomial distribution exists and so binomial coefficient is defined for negative value of n. So my question is should the function be expanded to calculate for negative n or is the function expected to work only in combination sense? -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: @steven.daprano > Are you also providing a perm(n, k) function? I didn't know it is also being implemented. Should I start on that too? My implementation is based on these requirements: > - Spell it comb(n, k). > - TypeError if args aren't ints. > - ValueError if not 0 <= k <= n. Should the bincoeff function be same with exception of allowing negative n? -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: @tim.peters Got it. -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35672] Error on divide
Yash Aggarwal added the comment: @Jorge Teran The division operator was changed in python 3. Now, if you use '/' for division between ints, the result would still be float. To get the same effect as python 2.x, you will have to use '//', i.e. floor division -- nosy: +FR4NKESTI3N ___ Python tracker <https://bugs.python.org/issue35672> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35656] More matchers in unittest.mock
Yash Aggarwal added the comment: I feel it would be better to have tolerance as an argument. -- nosy: +FR4NKESTI3N ___ Python tracker <https://bugs.python.org/issue35656> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35656] More matchers in unittest.mock
Yash Aggarwal added the comment: > due to floating-point inexactness +1 Its not easy to predict when calculated value will not be equal to expected theoretical value. for example math.cos(radians(90)) is something like 6e-17 rather than 0. Testing for this exact value would be just awkward. assertAlmostEqual() is already there in unittest for such comparisons so it wouldn't be completely nonsensical to have something like APPROX -- ___ Python tracker <https://bugs.python.org/issue35656> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: Agreed, comb sounds much better than combination. And using the name binomial would make it sound like something that would puke out whole binomial series rather than a single coefficient(maybe leave it for that in case is it decided to be useful in the future). PR 11414 implements simple algorithm that performs slower than using a factorial definition for k>n/3. @kellerfuchs I'd prefer if we could work on this since it's conflict free and already reflects the behavior everyone agreed upon. Would it be better to create a separate issue for math.perm to discuss its behavior? If the behavior of comb is satisfactory, can we start with optimizations? -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: Can I get a consensus on weather math.perm() is needed? -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: @mark.dickinson Ok, then I will work on comb for now then. -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35431] Add a function for computing binomial coefficients to the math module
Yash Aggarwal added the comment: @mark.dickinson both pr's are more or less same. Keller was offline for some time so I made the new issue. They were merged later. Only difference is in unittests. I'd say it's up to you to decide which one to keep. -- ___ Python tracker <https://bugs.python.org/issue35431> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com