Python -- floating point arithmetic

Stefan Krah stefan-usenet at bytereef.org
Thu Jul 8 14:11:34 EDT 2010


Mark Dickinson <dickinsm at gmail.com> wrote:
> 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. :)?

Not at the moment, but I'll keep trying. :)


Stefan Krah





More information about the Python-list mailing list