[issue37132] Add a module for integer related math functions

2020-05-07 Thread Mark Dickinson
Mark Dickinson added the comment: See also #40028 -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue37132] Add a module for integer related math functions

2019-06-03 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Well, then closing this. -- resolution: -> rejected stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Tim Peters
Tim Peters added the comment: Ya, I'm mostly with Raymond. `math` was originally a very thin wrapper around C's libm, but we've been moving away from that more and more for decades, and it's no longer the case anyway that the vast bulk of new Python programmers are intimately familiar with

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: After the beta feature freeze, I'll write up an edit the math module docs that makes in easier to find functions (by splitting out a section of the docs for these functions and by creating a summary link table at the top like we do for builtins). I reall

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: -1 I prefer these functions get left in the regular math module and just organize the docs to separate out integer functions. Additional namespacing creates cognitive load and creates a findability problem. Also, I really don't want gcd() to be moved yet

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Mark Dickinson
Mark Dickinson added the comment: I'm pretty much out of core-dev cycles for this weekend; I'm happy to review GH-13741, but won't have time to do so before next weekend. I'm overall -0 on this change; there's a minor benefit in the separation, but for me it's outweighted by the duplication

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Actually it was ilog2. There was just an error in the documentation. Currently we have two ways to represent the number as an integer ratio. The official way is two properties numerator and denominator, every number should have them. And some concrete nume

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Mark Dickinson
Mark Dickinson added the comment: I think the new `as_integer_ratio` also needs discussion: it was agreed at some point in the past to add `as_integer_ratio` *methods* on all numeric built-in types, and there's a PR for that. Adding `as_integer_ratio` as a new function too seems like two way

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > What's the plan for the existing functions `math.gcd` and `math.factorial`? I think they should eventually get deprecated, but with long term of deprecation. Deprecation warning should be added only when imath versions are already available in older Pyth

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Mark Dickinson
Mark Dickinson added the comment: > Should `imath.isqrt` be renamed to `imath.sqrt`? On futher reflection, I don't think it should. It's a different function, so it's not like comparing `math.sqrt` and `cmath.sqrt`. One more: I suggest renaming the new function `ilog` to `ilog2`, for consis

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Mark Dickinson
Mark Dickinson added the comment: Some questions: - What's the plan for the existing functions `math.gcd` and `math.factorial`? Do they eventually get deprecated, or do we keep `gcd` and `factorial` in both `math` and `imath`? - Does PEP 399 apply here? If so, we'll need a pure Python versi

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +13624 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13741 ___ Python tracker ___

[issue37132] Add a module for integer related math functions

2019-06-02 Thread Serhiy Storchaka
New submission from Serhiy Storchaka : The math module contains as function for floating-point numbers, as wells as functions for integer only numbers: factorial(), gcd(). Yet few integer specific functions was added in 3.8: isqrt(), perm(), comb(). The proposed PR adds the new imath module,