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
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).
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