Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #38187

Re: Decimal 0**0

Date 2013-02-05 14:05 +0100
From Stefan Krah <stefan@bytereef.org>
Subject Re: Decimal 0**0
References <5110fa5c$0$29982$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.1364.1360069967.2939.python-list@python.org> (permalink)

Show all headers | View raw


Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote:
> Does anyone have an explanation why Decimal 0**0 behaves so differently from
> float 0**0?
> 
> Tested in both Python 2.7 and 3.3, float 0**0 returns 1, as I would expect:

The behavior follows the specification:

http://speleotrove.com/decimal/daops.html#refpower


Why exactly the decision was made I cannot say.



Stefan Krah


Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Decimal 0**0 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-05 23:26 +1100
  Re: Decimal 0**0 Stefan Krah <stefan@bytereef.org> - 2013-02-05 14:05 +0100
  Re: Decimal 0**0 Tim Roberts <timr@probo.com> - 2013-02-06 21:47 -0800
    Re: Decimal 0**0 Terry Reedy <tjreedy@udel.edu> - 2013-02-07 03:38 -0500
    Re: Decimal 0**0 Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-02-08 10:31 +1100

csiph-web