> -----Original Message----- > From: Python-Dev <python-dev-bounces+tritium- > [email protected]> On Behalf Of Greg Ewing > Sent: Saturday, September 29, 2018 9:50 PM > To: [email protected] > Subject: Re: [Python-Dev] Change in Python 3's "round" behavior > > I don't really get the statistical argument. If you're doing something > like calculating an average and care about accuracy, why are you rounding > the values before averaging? Why not average first and then round the > result if you need to? > Other use case is finance, where you can end up with interest calculations that are fractional of the base unit of currency. US2ドル.345 is impossible to represent in real currency, so it has to be rounded. With half-towards-even, that rounds to 2ドル.34, and 2ドル.355 rounds to 2ドル.36. It evens out in the long run. While that is very helpful for finance calculations, if you are doing finance with that level of precision, you should be using decimal instead of float anyways and decimal's round has configurable round method. > -- > Greg > > _______________________________________________ > Python-Dev mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: https://mail.python.org/mailman/options/python-dev/tritium- > list%40sdamon.com _______________________________________________ Python-Dev mailing list [email protected] https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
- [Python-Dev] Change in Python 3's "round" behavi... jab
- Re: [Python-Dev] Change in Python 3's "round&quo... Steven D'Aprano
- Re: [Python-Dev] Change in Python 3's "round&quo... Greg Ewing
- Re: [Python-Dev] Change in Python 3's "round... Steven D'Aprano
- Re: [Python-Dev] Change in Python 3's "r... Alex Walters
- Re: [Python-Dev] Change in Python 3's &qu... Greg Ewing
- Re: [Python-Dev] Change in Python 3'... Alex Walters
- Re: [Python-Dev] Change in Pytho... Greg Ewing
- Re: [Python-Dev] Change in P... Steven D'Aprano
- Re: [Python-Dev] Change in P... Chris Angelico
- Re: [Python-Dev] Change in Python 3's &qu... Steven D'Aprano
- Re: [Python-Dev] Change in Python 3'... Chris Angelico
- Re: [Python-Dev] Change in Pytho... Greg Ewing
- Re: [Python-Dev] Change in P... Chris Angelico
- Re: [Python-Dev] Change in P... Richard Damon
- Re: [Python-Dev] Change in Python 3'... Greg Ewing
- Re: [Python-Dev] Change in Python 3'... Michael Felt