Decimals and other numbers

Devin Jeanpierre jeanpierreda at gmail.com
Fri Jan 9 04:02:31 CET 2015


On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel <davea at davea.name> wrote:
> What you don't say is which behavior you actually expected.  Since 0**0 is
> undefined mathematically, I'd expect either an exception or a NAN result.

It can be undefined, if you choose for it to be. You can also choose
to not define 0**1, of course. If 0**0 is defined, it must be 1. I
Googled around to find a mathematician to back me up, here:
http://arxiv.org/abs/math/9205211 (page 6, "ripples").

I expected 1, nan, or an exception, but more importantly, I expected
it to be the same for floats and decimals.

BTW, Ben, you linked to a file on your hard drive. You meant
https://docs.python.org/2/library/decimal.html#decimal.InvalidOperation

-- Devin



More information about the Python-list mailing list