Path: csiph.com!usenet.pasdenom.info!aioe.org!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.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'pycon.': 0.04; 'beer': 0.05; 'float': 0.07; 'anders': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; 'suggest': 0.14; 'creates': 0.14; 'claim,': 0.16; 'false:': 0.16; 'nan': 0.16; 'received:gateway01.websitewelcome.com': 0.16; 'wrote:': 0.18; 'implementing': 0.19; 'numerical': 0.19; 'rules': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "i'm": 0.30; 'comparison': 0.31; 'developers.': 0.31; 'anyone': 0.31; 'lists': 0.32; 'everyone': 0.33; 'created': 0.35; 'something': 0.35; 'objects': 0.35; 'one,': 0.35; 'next': 0.36; 'useful': 0.36; 'charset:us-ascii': 0.36; "i'll": 0.36; 'easily': 0.37; 'being': 0.38; 'problems': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'mailing': 0.39; 'received:173': 0.61; 'simply': 0.61; 'offer': 0.62; 'show': 0.63; 'real': 0.63; 'provide': 0.64; 'forward': 0.65; 'here': 0.66; 'anything.': 0.68; 'received:69.56': 0.68; 'useful.': 0.68; 'behavior': 0.77; 'subject:For': 0.78 Date: Wed, 09 Jul 2014 09:42:28 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: NaN comparisons - Call For Anecdotes References: <53BC05FB.4050707@jmunch.dk> In-Reply-To: <53BC05FB.4050707@jmunch.dk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source-IP: 173.12.184.233 X-Exim-ID: 1X4uwu-0001df-JA X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:60603 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 2 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= 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: 1404924234 news.xs4all.nl 2891 [2001:888:2000:d::a6]:48921 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:74263 On 07/08/2014 07:53 AM, Anders J. Munch wrote: > > So I make this claim: float.__eq__ implementing IEEE-754 NaN > comparison rules creates real problems for developers. And it has > never, ever, helped anyone do anything. > > "Never" is a strong claim, and easily disproven if false: Simply > provide a counterexample. So that is my challenge: If you have a > program (a pre-existing and useful one, not something artificial > created for this challenge) that benefits from NaN!=NaN and that would > fail if x==x for all float objects x, then please come forward and > show it, and I'll buy you a beer the next time I'm at PyCon. I would suggest you ask for this on the numerical mailing lists instead of here -- and you may not want to offer a beer to everyone that has an anecdote for NaN behavior being useful. -- ~Ethan~