Stefan Krah added the comment:
We can add a fast Decimal.as_integer_ratio() in C.
That said, why is the sum of Decimals not done in decimal arithmetic
with a very high context precision? It would be exact and with usual exponents
in the range [-384, 383] it should be very fast.
>>> c.prec = 50
>>> sum([D("1e50"), D(1), D("-1e50")] * 1000)
Decimal('0E+1')
>>>
>>> c.prec = 51
>>> sum([D("1e50"), D(1), D("-1e50")] * 1000)
Decimal('1000')
----------
nosy: +skrah
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20499>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com