Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news2.arglkargh.de!news.albasani.net!news.stack.nl!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.020 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'true,': 0.05; 'subject:Why': 0.09; 'cc:addr:python-list': 0.11; 'division.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'mod': 0.31; 'sep': 0.31; 'agree': 0.35; 'received:google.com': 0.35; 'there': 0.35; "didn't": 0.36; 'possible': 0.36; 'should': 0.36; 'too': 0.37; 'talking': 0.65; 'to:none': 0.92 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=yReCzpkmPw5gSwt71aTSpx9GupF43XbAkh4Qu6J25rA=; b=Cg8rbmDVCW0v2rZC1N2pBUx+JARZOWhrLQCt1XRPUr5w4TmLbj9uuuXOdH9vf4sT+Z pLfsIFBcsIbubrzzvde+jBGYlaDnOowLXxUoDeAKA6n5wRFA4q9pV8EXvAle5Bo4kq0v nn/4mUHA96U/KFUyNPC8gZgYpTelREZgdUaxtXCdUU1Df+SvtBj+YWRfbhiVsOC0mkYr YsNYViAkCJa1PR5Jm+eEuB5mCA7263EU1kKvnWHSQDw81/SKVXnyyL7sVpXrSHdZRyoM Ms8T8Osv391aiYeiDwy2n6Q1/s0YbpneRuLY8N5vbkwiCyCCqCdLO70KRk74HZt76BrU 6/zw== MIME-Version: 1.0 X-Received: by 10.50.117.65 with SMTP id kc1mr7320997igb.34.1410967762855; Wed, 17 Sep 2014 08:29:22 -0700 (PDT) In-Reply-To: <151e45ce-444d-441c-b59b-67e2aee3882b@googlegroups.com> References: <06397cb3-8baf-4af1-8152-ff7c3f6ceb62@googlegroups.com> <151e45ce-444d-441c-b59b-67e2aee3882b@googlegroups.com> Date: Thu, 18 Sep 2014 01:29:22 +1000 Subject: Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1410967765 news.xs4all.nl 2842 [2001:888:2000:d::a6]:47746 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77967 On Thu, Sep 18, 2014 at 1:16 AM, cool-RR wrote: > I didn't ask for the modulo, I agree it should remain NaN. I'm talking about the floor division. > Invariant: div*y + mod == x. If mod is NaN, there is no possible value for div that will make the invariant true, ergo it too has to be NaN. ChrisA