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: 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: References: <06397cb3-8baf-4af1-8152-ff7c3f6ceb62@googlegroups.com> Date: Thu, 18 Sep 2014 07:37:55 +1000 Subject: Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` From: Chris Angelico Cc: Python 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Thu, Sep 18, 2014 at 4:03 AM, Ian Kelly wrote: > On Wed, Sep 17, 2014 at 9:10 AM, Chris Angelico 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