Re: long(Decimal) performance

2006-08-12 Thread ajaksu
Hi Aahz, thanks for the feedback! Aahz wrote: > I'm not sure why it's coded that, but it's somewhat irrelevant: right > now, work is being done to convert decimal.py to C code, which will > almost certainly be much faster than your code. Generally speaking, you > should not be using Decimal now w

Re: long(Decimal) performance

2006-08-12 Thread Aahz
In article <[EMAIL PROTECTED]>, ajaksu <[EMAIL PROTECTED]> wrote: > >Running long(Decimal) is pretty slow, and the conversion is based on >strings. I'm trying to figure out whether there is a good reason for >using strings like in decimal.py (that reason would be bound to bite me >down the road).

Re: long(Decimal) performance

2006-08-11 Thread ajaksu
Sorry... I'm ashamed to submit such awful code in my first post. Let me try again... from decimal import Decimal def dec2long(number): """ Convert decimal.Decimal to long """ longstring = str(number) if "e" in longstring: radix, exponent = longstring.split("e") elif "E" in

long(Decimal) performance

2006-08-11 Thread ajaksu
Hello c.l.p.ers :) Running long(Decimal) is pretty slow, and the conversion is based on strings. I'm trying to figure out whether there is a good reason for using strings like in decimal.py (that reason would be bound to bite me down the road). This converts Decimal to long and is much faster in m