Facundo Batista wrote: > I'm preparing the pre-PEP of a Money module, and I don't want to > explain the rounding methods there again. > > So my idea was to point to Decimal documentation regarding them. And I > couldn't find them. > > Could it be we missed the explanation of each rounding mode in the > Decimal docs? Or the sprints burned my head? > > If somebody confirm me that they're not explained, I'll open a bug to > myself to do it... The best I found was this bit in the documentation of the 'Context' constructor: "The rounding option is one of: ROUND_CEILING (towards Infinity), ROUND_DOWN (towards zero), ROUND_FLOOR (towards -Infinity), ROUND_HALF_DOWN (towards zero), ROUND_HALF_EVEN, ROUND_HALF_UP (away from zero), or ROUND_UP (away from zero)." Something a bit more forthcoming probably wouldn't hurt - specifically, explaining the reasoning behind 'ROUND_HALF_EVEN' would be good. Maybe you could put some headings on the 'Floating point notes' page and include an explanation of the rounding modes with the two existing discussions on that page: - Rounding Errors and Precision (existing) - Rounding Modes (new) - Special Floating Point Values (existing) Regards, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://boredomandlaziness.blogspot.com
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4