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


Groups > comp.lang.python > #38337

Re: Decimal 0**0

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'float': 0.05; 'arguments': 0.07; 'differently': 0.07; '754': 0.09; 'explanation': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'bug': 0.10; '754,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'tim': 0.18; 'define': 0.20; 'doc': 0.22; 'programming': 0.23; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'url:wiki': 0.26; 'am,': 0.27; 'separate': 0.27; 'header:X-Complaints-To:1': 0.28; 'arithmetic': 0.29; "d'aprano": 0.29; 'decimal': 0.29; 'steven': 0.29; 'url:wikipedia': 0.29; 'no,': 0.29; 'specialist': 0.30; 'function': 0.30; 'anyone': 0.33; 'to:addr:python-list': 0.33; 'languages': 0.33; 'text.': 0.35; 'received:org': 0.36; 'except': 0.36; 'but': 0.36; 'url:org': 0.36; 'does': 0.37; 'why': 0.37; 'subject:: ': 0.38; 'url:en': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'end': 0.40; 'think': 0.40; 'ever': 0.63; '854': 0.84; 'adhere': 0.84; 'received:fios.verizon.net': 0.84; 'promised': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Terry Reedy <tjreedy@udel.edu>
Subject Re: Decimal 0**0
Date Thu, 07 Feb 2013 03:38:01 -0500
References <5110fa5c$0$29982$c3e8da3$5496439d@news.astraweb.com> <urf6h8hskvc5hf04d8js2n7kgv653bs976@4ax.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding quoted-printable
X-Gmane-NNTP-Posting-Host pool-173-75-251-66.phlapa.fios.verizon.net
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0
In-Reply-To <urf6h8hskvc5hf04d8js2n7kgv653bs976@4ax.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1442.1360226325.2939.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1360226325 news.xs4all.nl 6883 [2001:888:2000:d::a6]:56239
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:38337

Show key headers only | View raw


On 2/7/2013 12:47 AM, Tim Roberts wrote:
> 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?
>> ...
>> I am familiar with the arguments for treating 0**0 as 0, or undefined, but
>> thought that except for specialist use-cases, it was standard practice for
>> programming languages to have 0**0 return 1. According to Wikipedia, the
>> IEEE 754 standard is for "pow" to return 1, although languages can define a
>> separate "powr" function to return a NAN.
>>
>> http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_power_of_zero
>>
>> I suspect this is a bug in Decimal's interpretation of the standard. Can
>> anyone comment?
>
> I don't think Decimal ever promised to adhere to IEEE 754, did it?

No, it follows
IBM’s General Decimal Arithmetic Specification, The General Decimal 
Arithmetic Specification.
IEEE standard 854-1987, Unofficial IEEE 854 Text.
links at end of intro in doc


-- 
Terry Jan Reedy

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