471,336 Members | 1,323 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,336 software developers and data experts.

Making decimal default datatype for floats during runtime

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.
Jun 21 '07 #1
0 761

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

21 posts views Thread by Batista, Facundo | last post: by
4 posts views Thread by Mark | last post: by
15 posts views Thread by Kay Schluehr | last post: by
13 posts views Thread by Girish Sahani | last post: by
17 posts views Thread by D'Arcy J.M. Cain | last post: by
6 posts views Thread by Terry Reedy | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.