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: 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 Subject: Re: Decimal 0**0 Date: Thu, 07 Feb 2013 03:38:01 -0500 References: <5110fa5c$0$29982$c3e8da3$5496439d@news.astraweb.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: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On 2/7/2013 12:47 AM, Tim Roberts wrote: > Steven D'Aprano wrote: >> >> Does anyone have an explanation why Decimal 0**0 behaves so differentl= y 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, t= he >> IEEE 754 standard is for "pow" to return 1, although languages can def= ine 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. C= an >> anyone comment? > > I don't think Decimal ever promised to adhere to IEEE 754, did it? No, it follows IBM=E2=80=99s General Decimal Arithmetic Specification, The General Decim= al=20 Arithmetic Specification. IEEE standard 854-1987, Unofficial IEEE 854 Text. links at end of intro in doc --=20 Terry Jan Reedy