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.

作者 mark.dickinson
收信人 mark.dickinson
日期 2010-05-25.12:55:57
SpamBayes Score 3.9621624e-05
Marked as misclassified
Message-id <1274792162.57.0.293855829379.issue8817@psf.upfronthosting.co.za>
In-reply-to
内容
The implementation of 'round' for Python integers uses a round-to-nearest form of divmod:  a, b -> q, r, where q is the nearest integer to a / b and r = a - b*q.

This form of divmod would be useful elsewhere.  In particular, it's currently needed for implementing multiplication and division of timedeltas by a float:  see issue 1289118  .

This patch exposes the operation to Python C code as _PyLong_Divmod_Near, and refactors long_round to use this operation.
历史
日期 用户 动作 参数
2010-05-25 12:56:02mark.dickinson修改recipients: + mark.dickinson
2010-05-25 12:56:02mark.dickinson修改messageid: <1274792162.57.0.293855829379.issue8817@psf.upfronthosting.co.za>
2010-05-25 12:56:00mark.dickinson链接issue8817 messages
2010-05-25 12:56:00mark.dickinson创建