Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #7071
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.005 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'flags': 0.05; 'marking': 0.07; 'exceptions': 0.09; 'pm,': 0.10; 'wrote:': 0.14; '"should"': 0.16; 'angelico': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'nan': 0.16; 'propagate': 0.16; 'subject:key': 0.16; 'subject:set': 0.16; 'trap': 0.16; 'want;': 0.16; 'float': 0.16; 'received:74.125.82.174': 0.16; 'received:mail- wy0-f174.google.com': 0.16; 'mon,': 0.17; 'meant': 0.18; 'slightly': 0.19; 'header:In-Reply-To:1': 0.21; 'appropriate': 0.21; 'detect': 0.22; 'memory': 0.22; "i'm": 0.27; 'message- id:@mail.gmail.com': 0.28; "python's": 0.29; 'second': 0.30; 'turned': 0.30; 'btw,': 0.30; 'sort': 0.31; 'it.': 0.31; 'steven': 0.32; 'does': 0.33; 'to:addr:python-list': 0.33; 'operations': 0.33; 'actually': 0.33; 'chris': 0.34; 'nobody': 0.34; 'curious': 0.35; "d'aprano": 0.35; 'sense,': 0.35; 'wanna': 0.35; 'using': 0.35; '(with': 0.36; 'idea': 0.36; 'uses': 0.36; 'presence': 0.37; 'received:google.com': 0.37; 'useful': 0.37; 'something': 0.37; 'pretty': 0.37; 'think': 0.38; 'received:74.125.82': 0.38; 'received:74.125': 0.38; 'but': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'to:addr:python.org': 0.39; 'your': 0.60; 'believe': 0.66; 'yourself': 0.68; 'imagine': 0.72; 'apart': 0.73; '100%': 0.80; 'politics,': 0.91 |
| 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=h8FTfPT3fuLXpBjTuwDaE7AX/GkPEpJykM2LyqVuyls=; b=kUSqqdA+NhkedXf6k2Hj/LKe7R0rqRRrOo/sYyP/JVDSjyDZya6oKJqG6iAEr2euUn aywxJCRxMAVY1/Zha/+NKzWuS6kNRye/nW1wsW2iG3eJrpQD0d7BCnji75looMzdrVFl /Nhx4PXhsUU+OkC+33Mg98347tS6iL54rjp1U= |
| 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=ic97oZGFUTzX53ZedFqRIlEn7OO43teCvGW/LE2RQgKLLpoACctGKjF5dD6QlSiBbr LwNPzOreN9DygJ0dDGjnhNa8yt/CaF5sbmfxEaZaQFSlu/nw2l8nuSyk+WVPBVS0FKiD qidsUVySF1dxqNToph7lQdfXmbrT2wBeTByGU= |
| MIME-Version | 1.0 |
| In-Reply-To | <4dec5e9f$0$29988$c3e8da3$5496439d@news.astraweb.com> |
| References | <4de6df06$0$29996$c3e8da3$5496439d@news.astraweb.com> <7d1ad033-b412-4ccb-8e7f-d5ef151e6804@glegroupsg2000goo.googlegroups.com> <mailman.2438.1307133316.9059.python-list@python.org> <ish1fg029vl@news1.newsguy.com> <mailman.2475.1307315609.9059.python-list@python.org> <4dec2ba6$0$29996$c3e8da3$5496439d@news.astraweb.com> <mailman.2480.1307333467.9059.python-list@python.org> <4dec5e9f$0$29988$c3e8da3$5496439d@news.astraweb.com> |
| Date | Mon, 6 Jun 2011 15:10:02 +1000 |
| Subject | Re: float("nan") in set or as key |
| From | Chris Angelico <rosuav@gmail.com> |
| 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 <python-list.python.org> |
| List-Unsubscribe | <http://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 | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2482.1307337010.9059.python-list@python.org> (permalink) |
| Lines | 35 |
| NNTP-Posting-Host | 82.94.164.166 |
| X-Trace | 1307337010 news.xs4all.nl 49045 [::ffff:82.94.164.166]:53149 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:7071 |
Show key headers only | View raw
On Mon, Jun 6, 2011 at 2:59 PM, Steven D'Aprano <steve+comp.lang.python@pearwood.info> wrote: > On Mon, 06 Jun 2011 14:11:03 +1000, Chris Angelico wrote: >> So does this mean that: >> (with signalling NANs) should trap on the second line but not the first? BTW, by "should" I meant "would if Python's float were 100% IEEE-754 compliant". > I don't think that there's any way to tell IEEE-754 for operations on > NANs to return signalling NANs. As I understand it, the idea is: > > > - if you want exceptions to signal, set the appropriate traps; > - if you want NANs that propagate through your calculation, clear the > traps and you'll get propagating NANs; > - if you need to detect the presence of a NAN in your calculation, you > can inspect the flags at any time and take whatever action you want; > - and if you want a signalling NAN, you have to inject it yourself into > your calculation, and then avoid using it. That makes plausible sense, at least. Get traps or propagate NANs. > I'm lead to believe that signalling NANs were added to satisfy politics, > but apart from being slightly useful for marking uninitialised memory > before use, nobody actually uses them in practice. I'm curious as to what sort of politics led to that. > Wanna see something cool? You can check for inexact arithmetic: > Not surprisingly, by default that's turned off :) Neat. That's going to be off trapping pretty much all the time, but I can imagine circumstances where you check the status at the end. ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: float("nan") in set or as key Carl Banks <pavlovevidence@gmail.com> - 2011-06-03 13:27 -0700
Re: float("nan") in set or as key Chris Angelico <rosuav@gmail.com> - 2011-06-04 06:35 +1000
Re: float("nan") in set or as key Chris Torek <nospam@torek.net> - 2011-06-05 22:54 +0000
Re: float("nan") in set or as key Chris Angelico <rosuav@gmail.com> - 2011-06-06 09:13 +1000
Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-06 01:21 +0000
Re: float("nan") in set or as key Chris Torek <nospam@torek.net> - 2011-06-06 01:56 +0000
Re: float("nan") in set or as key Chris Angelico <rosuav@gmail.com> - 2011-06-06 14:11 +1000
Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-06 04:59 +0000
Re: float("nan") in set or as key Chris Angelico <rosuav@gmail.com> - 2011-06-06 15:10 +1000
Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-04 04:54 +0000
Re: float("nan") in set or as key Ethan Furman <ethan@stoneleaf.us> - 2011-06-03 23:04 -0700
Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-04 09:35 +0000
Re: float("nan") in set or as key Ben Finney <ben+python@benfinney.id.au> - 2011-06-04 20:20 +1000
Re: float("nan") in set or as key Ethan Furman <ethan@stoneleaf.us> - 2011-06-04 14:28 -0700
Re: float("nan") in set or as key Robert Kern <robert.kern@gmail.com> - 2011-06-04 16:49 -0500
Re: float("nan") in set or as key Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-05 02:03 +0000
Re: float("nan") in set or as key Robert Kern <robert.kern@gmail.com> - 2011-06-05 14:44 -0500
csiph-web