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


Groups > comp.lang.python > #83398

Re: Decimals and other numbers

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 <jeanpierreda@gmail.com>
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 <CABicbJK-5izGtet8BsS1Yqx+6AHMX7gLU4zYjjt5jULJXNVipA@mail.gmail.com> <54AF405C.6020609@davea.name>
From Devin Jeanpierre <jeanpierreda@gmail.com>
Date Thu, 8 Jan 2015 19:02:31 -0800
Subject Re: Decimals and other numbers
To Dave Angel <davea@davea.name>
Content-Type text/plain; charset=UTF-8
Cc "comp.lang.python" <python-list@python.org>
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 <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.17501.1420772593.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Thu, Jan 8, 2015 at 6:43 PM, Dave Angel <davea@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

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


Thread

Re: Decimals and other numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-08 19:02 -0800
  Re: Decimals and other numbers Marko Rauhamaa <marko@pacujo.net> - 2015-01-09 09:28 +0200
    Re: Decimals and other numbers Chris Angelico <rosuav@gmail.com> - 2015-01-09 18:37 +1100
      Re: Decimals and other numbers Marko Rauhamaa <marko@pacujo.net> - 2015-01-09 11:31 +0200
    Re: Decimals and other numbers Dave Angel <davea@davea.name> - 2015-01-09 02:49 -0500
    Re: Decimals and other numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-09 00:51 -0800
      Re: Decimals and other numbers Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2015-01-09 11:07 +0200
        [OT] x**y == y**x Peter Pearson <pkpearson@nowhere.invalid> - 2015-01-09 17:46 +0000
          Re: [OT] x**y == y**x Marko Rauhamaa <marko@pacujo.net> - 2015-01-09 23:41 +0200
            Re: [OT] x**y == y**x Peter Pearson <pkpearson@nowhere.invalid> - 2015-01-10 16:57 +0000
  Re: Decimals and other numbers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-09 19:49 +1100
    Re: Decimals and other numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-09 00:58 -0800
      Re: Decimals and other numbers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-09 21:20 +1100
        Re: Decimals and other numbers Chris Angelico <rosuav@gmail.com> - 2015-01-09 21:39 +1100
          Re: Decimals and other numbers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-09 23:24 +1100
            Re: Decimals and other numbers Chris Angelico <rosuav@gmail.com> - 2015-01-09 23:34 +1100
        Re: Decimals and other numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-09 17:25 -0800
        Re: Decimals and other numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-01-10 16:08 +1300
    Re: Decimals and other numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-09 01:11 -0800
    Re: Decimals and other numbers Marko Rauhamaa <marko@pacujo.net> - 2015-01-09 11:34 +0200
      Re: Decimals and other numbers Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-01-09 22:03 +1100
    Re: Decimals and other numbers Marko Rauhamaa <marko@pacujo.net> - 2015-01-09 11:44 +0200
    Re: Decimals and other numbers Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2015-01-10 16:05 +1300
      Re: Decimals and other numbers Devin Jeanpierre <jeanpierreda@gmail.com> - 2015-01-09 19:57 -0800

csiph-web