Making decimal default datatype for floats during runtime
stefan.sonnenberg at pythonmeister.com
Thu Jun 21 09:34:23 CEST 2007
I was wondering if there are any tricks around to
do some sort of changing types, float in particular.
I do many operations like summing etc on lots
of floats and always have to do some extra checks where
results are heading 0.0, like round(n,10) for example.
My idea was to tell python in some way not to take the type
float but decimal in an implicit fassion.
It that possible ?
And, is it still true for python 2.4/2.5 that one needs to do
a = Decimal(str(aFloat))
a = Decimal(aFloat)
as it is in python 2.3 ?
And, at least, has some tried to link (lib)python against tc_malloc
and benchmarked it ?
Thx in advance.
More information about the Python-list