Python -- floating point arithmetic

Mark Dickinson dickinsm at gmail.com
Thu Jul 8 13:07:23 EDT 2010


On Jul 8, 2:59 pm, Stefan Krah <stefan-use... at bytereef.org> wrote:
> pow() is trickier. Exact results have to be weeded out before
> attempting the correction loop for correct rounding, and this is
> complicated.
>
> For example, in decimal this expression takes a long time (in cdecimal
> the power function is not correctly rounded):
>
> Decimal('100.0') ** Decimal('-557.71e-742888888')

Hmm.  So it does.  Luckily, this particular problem is easy to deal
with.  Though I dare say that you have more up your sleeve. :)?

--
Mark



More information about the Python-list mailing list