Making decimal default datatype for floats during runtime

  • Thread starter Stefan Sonnenberg-Carstens
  • Start date
S

Stefan Sonnenberg-Carstens

Hi,
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))
instead of
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top