PEP 327: Decimal Data Type
bokr at oz.net
Fri Feb 6 19:56:03 CET 2004
On 5 Feb 2004 09:16:51 -0500, aahz at pythoncraft.com (Aahz) wrote:
>In article <6ltk10h30riel0lghd18t5unjco2g26spi at 4ax.com>,
>Stephen Horne <steve at ninereeds.fsnet.co.uk> wrote:
>>On Fri, 30 Jan 2004 09:49:05 -0300, "Batista, Facundo"
>><FBatista at uniFON.com.ar> wrote:
>>>I'll apreciate any feedback. Thank you all in advance.
>>My concern is that many people will use a decimal type just because it
>>is there, without any consideration of whether they actually need it.
>>95% of the time or more, all you need to do to represent money is to
>>use an integer and select appropriate units (pence rather than pounds,
>>cents rather than dollars, etc) so that the decimal point is just a
>>presentation issue when the value is printed/displayed but is never
>>needed in the internal representation.
>The problem lies precisely in that representation. For starters, a
>binary integer is O(n^2) for conversion to decimal printing. Then
Please clarify. What is your "n" in that?
More information about the Python-list