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


Groups > comp.lang.python > #77983

Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))`

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'float': 0.07; 'modulo': 0.09; 'raises': 0.09; 'subject:Why': 0.09; 'cc:addr:python-list': 0.11; 'missed': 0.12; 'discussed.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'infinity': 0.16; 'infinity,': 0.16; 'real.': 0.16; 'zero,': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'trying': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; "shouldn't": 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'define': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'along': 0.30; "i'm": 0.30; 'lines': 0.31; 'sep': 0.31; 'with,': 0.31; 'stuff': 0.32; 'worked': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'really': 0.36; 'issue': 0.38; 'anything': 0.39; 'sure': 0.39; 'ian': 0.60; 'number,': 0.60; 'natural': 0.68; 'anything.': 0.68; 'prime': 0.74; 'brain,': 0.84; 'divided': 0.91; 'to:none': 0.92; 'serious': 0.97
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=gK/qiCX7YPDX2NtBlGGNYrdbq69g7fCKA8ta0yFj21E=; b=PRmzySodxgDBqINdJ43nJ772LKTukAO43VSZD7CN1QStIK8YlyLgWLzqFODV644/tO QGk5cI8MInAMpTa1IVYIiGn3WCAoaP8CpUoMm7pbxSj5uzN++VGf4rO2uKsvDGeraDto hg1B9jGWE9N/tIa6pg0KGoxEjaiOGTBKPGPqGHLRHfW7lFysC04Bn4nsjqRudqV5a5mo 5FQ21ck7i3ESlLU9Q/TXqUU4dNt3wDUnqdf739BDo/YUC/Chwc8QlYO09o4BeHSLcPiT jX1NuXzvUOPWiSEyor7faPtYgvnTJqM18UkumlXUfjsU4IwYRt1Gt0x/62rTYlfAON7p ZZvw==
MIME-Version 1.0
X-Received by 10.42.231.9 with SMTP id jo9mr8370297icb.12.1410989875542; Wed, 17 Sep 2014 14:37:55 -0700 (PDT)
In-Reply-To <CALwzid=Tx=sB3fSqUbPa79hFdcerijv+OodwwQJSgORU-eM1=g@mail.gmail.com>
References <06397cb3-8baf-4af1-8152-ff7c3f6ceb62@googlegroups.com> <mailman.14066.1410916403.18130.python-list@python.org> <fd859066-7068-4a43-a9f0-0e9cc6949cf6@googlegroups.com> <CAPTjJmozvQ-Ndda46UcQELfCOjYi3xjUiyCoHOJKbQmmHPVpdg@mail.gmail.com> <CALwzid=Tx=sB3fSqUbPa79hFdcerijv+OodwwQJSgORU-eM1=g@mail.gmail.com>
Date Thu, 18 Sep 2014 07:37:55 +1000
Subject Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))`
From Chris Angelico <rosuav@gmail.com>
Cc Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.14089.1410989884.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1410989884 news.xs4all.nl 2854 [2001:888:2000:d::a6]:52202
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:77983

Show key headers only | View raw


On Thu, Sep 18, 2014 at 4:03 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Wed, Sep 17, 2014 at 9:10 AM, Chris Angelico <rosuav@gmail.com> wrote:
>> And while it's
>> conceivable to define that infinity divided by anything is infinity,
>> and infinity modulo anything is zero, that raises serious issues of
>> primality and such; I'm not sure that that would really help anything.
>
> I missed that this point was already discussed. Can you elaborate on
> the "serious issues of primality and such"? Since infinity is not a
> natural number, its primality is undefined, so I don't see the issue
> here.

It's not something I've personally worked with, so I'm trying to
dredge stuff up from my brain, but I think there's something along the
lines of "stuff shouldn't be a multiple of everything" and the Prime
Number Theorem. But that may just be a case where float != real.

ChrisA

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


Thread

Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` cool-RR <ram.rachum@gmail.com> - 2014-09-16 14:40 -0700
  Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Terry Reedy <tjreedy@udel.edu> - 2014-09-16 21:12 -0400
    Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` cool-RR <ram.rachum@gmail.com> - 2014-09-17 07:55 -0700
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Chris Angelico <rosuav@gmail.com> - 2014-09-18 01:10 +1000
        Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` cool-RR <ram.rachum@gmail.com> - 2014-09-17 08:16 -0700
          Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Chris Angelico <rosuav@gmail.com> - 2014-09-18 01:29 +1000
            Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` cool-RR <ram.rachum@gmail.com> - 2014-09-17 09:33 -0700
              Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Chris Angelico <rosuav@gmail.com> - 2014-09-18 02:37 +1000
              Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-18 13:11 +1000
                Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` cool-RR <ram.rachum@gmail.com> - 2014-09-18 01:43 -0700
          Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-17 09:34 -0600
          Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Chris Angelico <rosuav@gmail.com> - 2014-09-18 01:40 +1000
            Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-18 12:50 +1000
          Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-17 10:12 -0600
          Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-17 10:30 -0600
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-17 12:03 -0600
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Chris Angelico <rosuav@gmail.com> - 2014-09-18 07:37 +1000
        Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-18 13:29 +1000
          Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Chris Angelico <rosuav@gmail.com> - 2014-09-18 13:47 +1000
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Terry Reedy <tjreedy@udel.edu> - 2014-09-17 19:23 -0400
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-18 00:51 -0600
  Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-17 09:35 -0600
  Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` wxjmfauth@gmail.com - 2014-09-17 23:22 -0700
    Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Marko Rauhamaa <marko@pacujo.net> - 2014-09-18 09:45 +0300
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` wxjmfauth@gmail.com - 2014-09-18 00:13 -0700
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-09-18 19:25 +1000
        Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` wxjmfauth@gmail.com - 2014-09-18 05:57 -0700
        Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Grant Edwards <invalid@invalid.invalid> - 2014-09-18 14:33 +0000
    Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` chris.barker@noaa.gov - 2014-09-18 09:35 -0700
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` Ian Kelly <ian.g.kelly@gmail.com> - 2014-09-18 11:05 -0600
      Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` wxjmfauth@gmail.com - 2014-09-18 23:48 -0700

csiph-web