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
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/
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
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