Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.055 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'exception,': 0.09; 'expected.': 0.09; 'undefined': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; 'ben,': 0.16; 'defined,': 0.16; 'googled': 0.16; 'nan': 0.16; 'url:decimal': 0.16; 'exception': 0.16; 'wrote:': 0.18; 'result.': 0.19; 'thu,': 0.19; 'meant': 0.20; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'define': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'subject:numbers': 0.31; 'subject:other': 0.31; 'file': 0.32; 'url:python': 0.33; "i'd": 0.34; 'but': 0.35; 'received:google.com': 0.35; 'url:org': 0.36; 'expected': 0.38; 'url:library': 0.38; 'pm,': 0.38; 'expect': 0.39; 'either': 0.39; 'course.': 0.60; 'dave': 0.60; 'up,': 0.60; 'here:': 0.62; 'back': 0.62; 'choose': 0.64; 'more': 0.64; 'linked': 0.65; 'importantly,': 0.68; 'behavior': 0.77; '2015': 0.84; 'drive.': 0.84; 'angel': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=2eW3/ZbUpo+9sCNTPY5tbTAI0dcsOxiK0E79sBfgIQo=; b=s2825s2bMFn+KkHRT2hONW+0dqgeihBcw3WSmpYmebROfEA4/Lo9FtjOynaRfN3G+J CL76Dotc9clzkCXZYIQcEDqsEhGAvL8sAQeGf+Yv/bF5pC06EXUtxiXLTwiBgMWiWbS8 EbfHGGLynCLKB/eBWWKpnxGw0yqcFqD9b97ugMoa5QOvRRflCQcrydI8JvP0a3siQlgw NKYizcxjAI7HVQ7juUT8DkbdxOvYIu0YEheFW9QUExp+x8EFwDOKDyzSSSs5P04maxEF thh1I/CzAx9/a0efx1sF8j63CYBUOG4iQWgpy4PpAQHqEnhCcH/zCyw5enQpSpnuWgEA VcoQ== X-Received: by 10.140.87.71 with SMTP id q65mr20996943qgd.67.1420772591545; Thu, 08 Jan 2015 19:03:11 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <54AF405C.6020609@davea.name> References: <54AF405C.6020609@davea.name> From: Devin Jeanpierre Date: Thu, 8 Jan 2015 19:02:31 -0800 Subject: Re: Decimals and other numbers To: Dave Angel Content-Type: text/plain; charset=UTF-8 Cc: "comp.lang.python" 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: 16 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1420772593 news.xs4all.nl 2898 [2001:888:2000:d::a6]:54820 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:83398 On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel 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