[Python-3000] Rounding in Py3k

2006-08-03 Thread Nick Coghlan
Some musings inspired by the rounding discussion on python-dev. The Decimal module provides all of the rounding modes from the general decimal arithmetic specification [1]. Both Decimal rounding methods (quantize() and to_integral()) return Decimal instances - a subsequent explicit conversion t

Re: [Python-3000] Rounding in Py3k

2006-08-03 Thread Greg Ewing
Nick Coghlan wrote: > The implicit Decimal->float conversion Hang on, I thought there weren't supposed to be any implicit conversions between Decimal and float. -- Greg ___ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/

Re: [Python-3000] Rounding in Py3k

2006-08-03 Thread Greg Ewing
Nick Coghlan wrote: > Would it be worthwhile to design a common rounding mechanism that can be used > to cleanly round values to the built in floating point type, as well as being > able to access the different rounding modes for decimal instances? Sounds like a job for a new protocol, such as

Re: [Python-3000] Rounding in Py3k

2006-08-03 Thread Ron Adam
Greg Ewing wrote: > Nick Coghlan wrote: > >> Would it be worthwhile to design a common rounding mechanism that can be >> used >> to cleanly round values to the built in floating point type, as well as >> being >> able to access the different rounding modes for decimal instances? > > Sounds li