@@ -34,23 +34,23 @@ when explicitly noted otherwise, all return values are floats." This is no
3434longer true: *None * of the functions listed in the `Number-theoretic
3535functions <https://docs.python.org/3.14/library/math.html#number-theoretic-functions> `_
3636subsection of the documentation returns a float, but the
37- documentation doesn't say so. In the proposed module a similar sentence "All
38- return values are integers." could tell the truth once . In a similar way we
37+ documentation doesn't say so. In the documentation for the proposed `` imath `` module the sentence "All
38+ return values are integers." would be accurate . In a similar way we
3939can simplify the description of the accepted arguments for functions in both the
4040:external+py3.14:mod: `math ` and the new module.
4141
42- Apparently, the :external+py3.14:mod: `math ` can't serve as a catch-all place
42+ Apparently, the :external+py3.14:mod: `math ` module can't serve as a catch-all place
4343for mathematical functions: we have also the :external+py3.14:mod: `cmath ` and
44- the :external+py3.14:mod: `statistics `. Let's do the same for integer-related
45- functions. It would provide shared context, which reduces verbosity in the
44+ :external+py3.14:mod: `statistics ` modules . Let's do the same for integer-related
45+ functions. It provides shared context, which reduces verbosity in the
4646documentation and conceptual load. It also aids discoverability through
47- grouping related functions and IDEs suggesting helpful completions .
47+ grouping related functions and makes IDE suggestions more helpful .
4848
4949
5050Specification
5151=============
5252
53- The PEP proposes moving the following integer-related functions in a new
53+ The PEP proposes moving the following integer-related functions to a new
5454module, called ``imath ``:
5555
5656* :external+py3.14:func: `~math.comb `
@@ -63,11 +63,11 @@ module, called ``imath``:
6363Their aliases in :external+py3.14:mod: `math ` will be :term: `soft deprecated `.
6464
6565Module functions will accept integers and objects that implement the
66- :external+py3.14:meth: `~object.__index__ ` method which is used to convert the
66+ :external+py3.14:meth: `~object.__index__ ` method, which is used to convert the
6767object to an integer number.
6868
6969Possible extensions for the new module and its scope are discussed in the
70- `Open Issues <Open Issues _>`_ section. New functions are not part of the
70+ `Open Issues <Open Issues _>`_ section. New functions are not part of this
7171proposal.
7272
7373
@@ -90,7 +90,7 @@ Open Issues
9090Module name
9191-----------
9292
93- Chosen name seems consistent with other domain-specific mathematical module:
93+ The chosen name seems consistent with one existing domain-specific mathematical module:
9494:external+py3.14:mod: `cmath ` (for complex numbers).
9595
9696There is already an ``imath `` project on PyPI, but only with two releases, with
@@ -100,7 +100,7 @@ include Python bindings with the same name.
100100
101101`Polling shows <https://discuss.python.org/t/91337/35 >`_ ``intmath `` as another
102102popular name. The argument made was that the normal mathematical spelling of
103- the imaginary unit is ``i ``, which makes imath ambiguous. It also has no conflict
103+ the imaginary unit is ``i ``, which makes `` imath `` ambiguous. It also has no conflict
104104with any PyPI module. On the other hand, ``intmath `` may be confused with
105105interval math or numerical integration.
106106
@@ -115,7 +115,7 @@ Unless we can just provide bindings to some well supported mathematical library
115115like the GMP, the module scope should be limited. For example, no efficient primality
116116testing and factorization.
117117
118- There are possible additions, among proposed in the initial discussion thread
118+ Some possible additions, among those proposed in the initial discussion thread
119119(see also issue
120120`python/cpython#81313 <https://github.com/python/cpython/issues/81313 >`_):
121121
@@ -124,10 +124,10 @@ There are possible additions, among proposed in the initial discussion thread
124124* ``gcdext() `` --- to solve linear `Diophantine equation <https://en.wikipedia.org/wiki/Diophantine_equation >`_ in two variables (the
125125 :external+py3.14:class: `int ` implementation actually includes an extended
126126 Euclidean algorithm)
127- * ``isqrt_rem() `` --- to return both integer square root and a remainder (if
127+ * ``isqrt_rem() `` --- to return both integer square root and a remainder (which is non-zero only if
128128 integer isn't a perfect square)
129129* ``ilog() `` --- integer logarithm, :external+py3.14:func: `math.log `
130- has a special handling for integer arguments. It's unique (with respect to other module
130+ has special handling for integer arguments. It's unique (with respect to other module
131131 functions) and not documented so far, see issue
132132 `python/cpython#120950 <https://github.com/python/cpython/issues/120950 >`_.
133133* ``fibonacci() `` --- `Fibonacci sequence <https://en.wikipedia.org/wiki/Fibonacci_sequence >`_.
@@ -146,8 +146,8 @@ would be confusing to give it the same name (under a different module).
146146Acknowledgements
147147================
148148
149- Thanks to Tim Peters for reviving the idea of the :external+py3.14:mod: `math `
150- splitting . Thanks to Neil Girdhar for substantial improvements of
149+ Thanks to Tim Peters for reviving the idea of splitting the :external+py3.14:mod: `math `
150+ module . Thanks to Neil Girdhar for substantial improvements of
151151the initial draft.
152152
153153
0 commit comments