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.

Author marco_ocram
Recipients marco_ocram, mark.dickinson, rhettinger, ronaldoussoren, stutzbach, veky
Date 2020-08-20.17:50:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1597945828.14.0.435380701121.issue41598@roundup.psfhosted.org>
In-reply-to
Content
about floats ...

https://docs.python.org/3/library/functions.html#round
"if two multiples are equally close, rounding is done toward the even choice (so, for example, both round(0.5) and round(-0.5) are 0, and round(1.5) is 2)"

i'm sure lots of users don't need this but a common math rounding as ...

https://docs.python.org/3/library/decimal.html#rounding-modes
decimal.ROUND_HALF_UP and as option in some cases decimal.ROUND_UP

the proposed function realize just this, for either positive and negative vals.

if you need to realize decimal.ROUND_DOWN function trunc is already fine.

i'm as mathematician have never used other roundings, i know the current round function work well in the accounting fiels but only there. in other languages sometimes the same problem (for example ms ones as old vb), really i and others don't know the reason.

about the revision of the standard function to accept an additional argument for different rounding types, for example all available for decimals, is ok for me, better if the default will be the normal accepted math rounding decimal.ROUND_HALF_UP ...

https://docs.python.org/3/library/decimal.html#decimal.BasicContext
decimal.BasicContext
This is a standard context defined by the General Decimal Arithmetic Specification. Precision is set to nine. Rounding is set to ROUND_HALF_UP.

about the floating point approximation in my opinion if you aren't a scientist you can find it pretty nice if you apply the right roundings. i think to have documented enough my request. take care.
History
Date User Action Args
2020-08-20 17:50:28marco_ocramsetrecipients: + marco_ocram, rhettinger, ronaldoussoren, mark.dickinson, stutzbach, veky
2020-08-20 17:50:28marco_ocramsetmessageid: <1597945828.14.0.435380701121.issue41598@roundup.psfhosted.org>
2020-08-20 17:50:28marco_ocramlinkissue41598 messages
2020-08-20 17:50:27marco_ocramcreate