def power, problem when raising power to decimals

Mark Dickinson dickinsm at
Thu Apr 17 15:38:11 CEST 2008

On Apr 16, 11:03 pm, "Terry Reedy" <tjre... at> wrote:
> | decimal.InvalidOperation: 0 ** 0
> I would think of this as a bug unless the standard Decimal follows demands
> this.

It does.  From

"If both operands are zero, or if the left-hand operand is less than
zero and the right-hand operand does not have an integral value[7]  or
is infinite, an Invalid operation condition is raised, the result is
[0,qNaN], and the following rules do not apply."

I'm hoping that this will change with the next update of the standard.


More information about the Python-list mailing list