Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeder.news-service.com!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'exception.': 0.09; 'inclined': 0.09; 'am,': 0.14; 'received:209.85.214.174': 0.14; 'received:mail-iw0-f174.google.com': 0.14; 'wrote:': 0.14; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'ignored,': 0.16; 'nans,': 0.16; 'subject:key': 0.16; 'subject:set': 0.16; 'tonight!': 0.16; 'trap': 0.16; 'mon,': 0.17; 'converted': 0.19; 'interesting.': 0.19; 'thanks,': 0.19; 'header:In-Reply-To:1': 0.21; "i'm": 0.27; 'message- id:@mail.gmail.com': 0.28; '(the': 0.28; 'url:edu': 0.28; 'received:209.85.214': 0.28; 'e.g.': 0.29; 'possible,': 0.29; 'second': 0.30; 'sort': 0.31; 'steven': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'operations': 0.33; 'chris': 0.34; "d'aprano": 0.35; '(with': 0.36; 'received:google.com': 0.37; 'received:209.85': 0.37; 'floating': 0.37; 'two': 0.37; 'think': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'received:209': 0.39; 'either': 0.39; 'to:addr:python.org': 0.39; 'more': 0.60; 'cause': 0.67; 'articles': 0.71; 'hey,': 0.74; 'article': 0.76; 'invited': 0.76; 'criticisms': 0.84; 'literature': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=0jnJdrUPxeATcLYRYXg2zooI892sNTUXAVDOIumMGDI=; b=OfPu1YiICukDoyeuWYSGN8ju6DXfJswgfxPO5tlfkniXNmuFQm7MHn4OXjFWBuCIko Ur7tfnCwIvvgH6Q03asGBEpFAVPgNLZ/NOaA8xyQ5LbUmBqKGcdvxPO56WLPO9RAbADi kI2sn9uIxjWkXT42OPrv61GZ+rrz7KKRt70c8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=JZuWWDJriVNRpnBGVnzhbmkCCBzLSuF3bhmOdbl3UKxIvP+UoM9ydToZusWyr+pxPM hUlhFIYzcMf68/Kf8ZVsXobml6R6NRndPwjpyY+F0Va2DOsFnQiD3Y7DnKgE2qoY38fB V03j9c4bLxMmYzhui1lwETvi648Ep7y53T0B0= MIME-Version: 1.0 In-Reply-To: <4dec2ba6$0$29996$c3e8da3$5496439d@news.astraweb.com> References: <4de6df06$0$29996$c3e8da3$5496439d@news.astraweb.com> <7d1ad033-b412-4ccb-8e7f-d5ef151e6804@glegroupsg2000goo.googlegroups.com> <4dec2ba6$0$29996$c3e8da3$5496439d@news.astraweb.com> Date: Mon, 6 Jun 2011 14:11:03 +1000 Subject: Re: float("nan") in set or as key From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 28 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307333467 news.xs4all.nl 49041 [::ffff:82.94.164.166]:46096 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7068 On Mon, Jun 6, 2011 at 11:21 AM, Steven D'Aprano wrote: > The intended behaviour is operations on "quiet NANs" should return NANs, > but operations on "signalling NANs" should cause a trap, which can either > be ignored, and converted into a quiet NAN, or treated as an exception. > > E.g. in Decimal: [snip] So does this mean that: a = 0.0/0.0 b = a + 1 (with signalling NANs) should trap on the second line but not the first? That's the first "operation on a nan". > http://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf > (The article is seven years old now, but as far as I know, the criticisms > still apply.) Thanks, that's my travel-home literature for tonight! :) I read the other two articles you sent me (asynchronously), and they're most interesting. I'm definitely still inclined to avoid any sort of floating point work if at all possible, but hey, this gives me more topics to bore people with at parties! (Wait. I never get invited to parties any more. I think my work on that front is complete.) Chris Angelico