[Python-ideas] Python Numbers as Human Concept Decimal System
Alexander Heger
python at 2sn.net
Sun Mar 9 10:37:32 CET 2014
>> Why do you say only financial?
Arbitrary precision is good - but why should it be done in a way that
is not natural to how machines work?
But I admit, I have not looked at the code how it is implemented.
Maybe it is done well (only saving integer part and an exponent). I
only recall the BCD standard used in Turbo Pascal - which was not so
great - and really mostly for financial use.
But there is no point in having fractions in decimal for computation,
unless the result has to have a good representation in a specific
base. Something you can send to a tax office. The decimal package
solves problems specific to financial. And, yes, it can be used for
other applications lacking other arbitrary precision classes in Python
standard class library - but it would not be my first choice for other
applications.
Hence I propose to have a different arbitrary precision package for
applications that do not require 'decimal' precision. As for class
hierarchy it likely should be a base class for the decimal package.
(Then you could even add other bases as well.)
More information about the Python-ideas
mailing list