Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

I thought about adding a public function in the math module when worked on one 
of that functions. But there are not many cases for it in the stdlib (datetime, 
fractions, decimal, and maybe it's all). I don't know whether there is a common 
enough need in third-party code. But there is a parallel with math.remainder().

If add this function, I would implement it in C and add in the math module. It 
already contains integer specific functions factorial() and gcd(). There was a 
proposition to add as_integer_ratio() (which will work with arbitrary 
rationals). All together they will create a small integer mathematics domain in 
the math module. Or can be extracted in a special module. Later it can be 
extended by adding functions for binomial coefficients and the number of 
permutations and generators of prime and Fibonacci numbers.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31978>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to