Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #77979
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!news.tele.dk!news.tele.dk!small.news.tele.dk!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.009 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'true,': 0.05; 'wednesday,': 0.07; 'subject:Why': 0.09; 'cc:addr:python-list': 0.11; 'developers,': 0.11; 'chris,': 0.16; '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; 'documented': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'mod': 0.31; 'sep': 0.31; 'maybe': 0.34; 'agree': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'like,': 0.36; 'returning': 0.36; "didn't": 0.36; 'possible': 0.36; 'should': 0.36; 'too': 0.37; 'whatever': 0.38; 'expect': 0.39; 'more': 0.64; '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=n/c7mzZiHEOcpzH/2DqYrCUAgnm3yXp+hgHpKI6ZyXA=; b=WQK/ycavhMYtUyyOqDwSwRTfNVZON52vCih9aeJc1tqbOkW3jvLGfNQFCle6nTKWdk +3bvdk+Le3w3t8+CHsoOw7TO15LcjzwO3Kt85iHgeFx0Aaex6bha2ARFKP5YkQJymwZM TNBSBK54k0XQyVxc7J1LvnHyTpuqcSXnaM4QpJ8uHMCXmIG5vdsA4X0eSSS0CelvZ1qa jUO2pYPzTTjFYQVVCZGC95eMA6L/GwW2WYUB3jcwrbSPceEBe60Z8Twu1QB4961lztQg ybhgq+nB94PByrhTICXIShnx48y+56XInJflPv9Ky0/AmtD/PcLxCJ86a9nlRswYOqFY 5Ivw== |
| MIME-Version | 1.0 |
| X-Received | by 10.51.17.2 with SMTP id ga2mr5782068igd.2.1410971870745; Wed, 17 Sep 2014 09:37:50 -0700 (PDT) |
| In-Reply-To | <adaa42e9-3b9a-40e0-a03d-e092c41ccaec@googlegroups.com> |
| References | <06397cb3-8baf-4af1-8152-ff7c3f6ceb62@googlegroups.com> <mailman.14066.1410916403.18130.python-list@python.org> <fd859066-7068-4a43-a9f0-0e9cc6949cf6@googlegroups.com> <mailman.14076.1410966617.18130.python-list@python.org> <151e45ce-444d-441c-b59b-67e2aee3882b@googlegroups.com> <mailman.14077.1410967765.18130.python-list@python.org> <adaa42e9-3b9a-40e0-a03d-e092c41ccaec@googlegroups.com> |
| Date | Thu, 18 Sep 2014 02:37:50 +1000 |
| Subject | Re: Why `divmod(float('inf'), 1) == (float('nan'), float('nan'))` |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <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.14085.1410971877.18130.python-list@python.org> (permalink) |
| Lines | 20 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1410971877 news.xs4all.nl 2974 [2001:888:2000:d::a6]:56323 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:77979 |
Show key headers only | View raw
On Thu, Sep 18, 2014 at 2:33 AM, cool-RR <ram.rachum@gmail.com> wrote: > On Wednesday, September 17, 2014 6:30:04 PM UTC+3, Chris Angelico wrote: >> On Thu, Sep 18, 2014 at 1:16 AM, cool-RR <ram.rachum@gmail.com> 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 > > Chris, why is this invariant `div*y + mod == x` so important? Maybe it's more important to return a mathematically reasonable result for the the floor-division result than to maintain this invariant? It's important because it's documented :) You can expect whatever you like, but if something's a documented invariant, that's more important than your expectations. Now, why was divmod documented as returning values adhering to that invariant? You'd have to ask the developers, I've no idea. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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