def power, problem when raising power to decimals
Terry Reedy
tjreedy at udel.edu
Thu Apr 17 05:03:10 CEST 2008
"Mark Dickinson" <dickinsm at gmail.com> wrote in message
news:fc48f8f0-202d-40c7-980d-5cbc403eed50 at y18g2000pre.googlegroups.com...
On Apr 16, 4:19 pm, skanem... at yahoo.se wrote:
> how do i solve power(5,1.3)?
>
[...]
>
> also i found a link which states 0^0 isnt 1 even though every
> calculator ive tried says it is.
> it doesnt say what it is but i presume 0 then.
> but it seems the dude is wrong and it is 1?
Define a**b as 1 multiplied by a b times. Then a**0 is clearly 1,
regardless of a.
But some do disagree.
| decimal.InvalidOperation: 0 ** 0
I would think of this as a bug unless the standard Decimal follows demands
this.
tjr
More information about the Python-list
mailing list