Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'argument': 0.04; 'bits': 0.07; 'python': 0.09; '754': 0.09; 'backwards': 0.09; 'behave': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'itself.': 0.11; 'suggest': 0.11; 'language': 0.14; '(but': 0.15; 'value.': 0.15; 'chaos': 0.16; 'discusses': 0.16; 'equality.': 0.16; 'nan': 0.16; 'nans': 0.16; 'oct': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:fails': 0.16; 'unequal': 0.16; 'wrote:': 0.17; 'numerical': 0.17; 'thu,': 0.17; 'jan': 0.18; '>>>': 0.18; 'issue.': 0.20; 'bit': 0.21; 'thus': 0.24; 'so.': 0.24; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'see,': 0.27; "doesn't": 0.28; 'header:X -Complaints-To:1': 0.28; 'consequence': 0.29; "d'aprano": 0.29; 'steven': 0.29; "i'm": 0.29; 'computing': 0.32; 'says': 0.33; 'to:addr:python-list': 0.33; 'false': 0.35; 'pm,': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'compare': 0.36; 'should': 0.36; 'why': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'nothing': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'step': 0.39; 'header:Received:5': 0.40; 'interest': 0.62; 'choose': 0.65; 'taking': 0.65; 'identity.': 0.65; 'believe': 0.69; 'fact,': 0.69; 'designers': 0.75; 'disagreement': 0.84; 'everything,': 0.84; 'follow,': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: a.index(float('nan')) fails Date: Fri, 26 Oct 2012 03:54:02 -0400 References: <5089f915$0$29984$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0 In-Reply-To: <5089f915$0$29984$c3e8da3$5496439d@news.astraweb.com> 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: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1351238073 news.xs4all.nl 6865 [2001:888:2000:d::a6]:38723 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:32198 On 10/25/2012 10:44 PM, Steven D'Aprano wrote: > On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote: > >> It is a consequence of the following, which some people (but not all) >> believe is mandated by the IEEE standard. >> >> >>> nan = float('nan') >> >>> nan is nan >> True > > The IEEE 754 standard says nothing about object identity. It only > discusses value equality. > >> >>> nan == nan >> False > > IEEE 754 states that all NANs compare unequal to everything, including > NANs with the same bit value. It doesn't make an exception for > comparisons with itself. > > I'm not entirely sure why you suggest that there is an argument about > what IEEE 754 says about NANs. I did not do so. > As far as I can see, the argument is > whether or not language designers should pick and choose which bits of > the standard they want to follow, thus taking a step backwards to the > chaos of numerical computing prior to the IEEE 754 standard. There has been disagreement about whether the standard mandates that Python behave the way it does. That is a fact, but I have no interest in discussing the issue. -- Terry Jan Reedy