Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74257

Re: NaN comparisons - Call For Anecdotes

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <2014@jmunch.dk>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.040
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'algorithm': 0.04; 'anders': 0.09; 'input,': 0.09; 'things,': 0.09; 'accepting': 0.14; 'nans': 0.16; 'retrieving': 0.16; 'storing': 0.16; 'tuples,': 0.16; 'unpack': 0.16; 'wrote:': 0.18; 'later': 0.20; 'seems': 0.21; 'example': 0.22; 'to:name:python-list@python.org': 0.22; 'header:User-Agent:1': 0.23; 'string,': 0.24; 'earlier': 0.24; 'handling': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'idea': 0.28; "d'aprano": 0.31; 'gather': 0.31; 'received:dk': 0.31; 'steven': 0.31; 'trivial': 0.31; 'values.': 0.31; 'text': 0.33; 'not.': 0.33; 'form.': 0.35; 'usual': 0.35; 'doing': 0.36; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'list,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'algorithms': 0.60; 'header:Return-path:1': 0.60; 'back': 0.62; 'such': 0.63; 'stand': 0.64; 'reply': 0.66; 'capable': 0.67; 'special': 0.74; 'subject:For': 0.78; 'calculations': 0.84; 'device,': 0.91; 'imagine': 0.93
Date Wed, 09 Jul 2014 17:08:15 +0200
From "Anders J. Munch" <2014@jmunch.dk>
Organization .
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
MIME-Version 1.0
To "python-list@python.org" <python-list@python.org>
Subject Re: NaN comparisons - Call For Anecdotes
References <mailman.11626.1404831235.18130.python-list@python.org> <53bc26ca$0$29995$c3e8da3$5496439d@news.astraweb.com> <mailman.11653.1404846131.18130.python-list@python.org> <53bc8861$0$29995$c3e8da3$5496439d@news.astraweb.com>
In-Reply-To <53bc8861$0$29995$c3e8da3$5496439d@news.astraweb.com>
Content-Type text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding 7bit
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.11692.1404918498.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1404918498 news.xs4all.nl 2832 [2001:888:2000:d::a6]:38465
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:74257

Show key headers only | View raw


Steven D'Aprano wrote:
> It seems to me that the trivial work-around is:
>
> * gather packed floats from some device, as ints
> * process them *as ints* in some way which requires reflexivity
> * unpack back into floats
> * (maybe) much later perform numeric calculations on them
>
>
> Although perhaps I don't understand your use-case.

Clearly you do not. floats are not ints. I have no idea how you imagine 
processing IEEE-754 floating-point values in int form.

My use case is: Working with IEEE-754 floating-point values. That means storing 
and retrieving them, serialising and transferring them, accepting them as user 
input, printing them, all the usual things you do with values.

And doing so in a way that does not require special handling in algorithms that 
are otherwise generic.
When the same algorithm is capable of dealing with ints, bytestrings, text 
string, tuples, list, dictionaries, time stamps, NoneType's, bools, 
floating-point floats and a thousand other things, then NaNs stand out as the 
values that have special algorithm-breaking magic.

I gave an example of such an algorithm in an earlier reply to Chris.

regards, Anders

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-08 16:53 +0200
  Re: NaN comparisons - Call For Anecdotes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-08 17:13 +0000
    Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-09 03:21 +1000
    Re: NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-08 21:02 +0200
      Re: NaN comparisons - Call For Anecdotes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-09 00:10 +0000
        Re: NaN comparisons - Call For Anecdotes Terry Reedy <tjreedy@udel.edu> - 2014-07-09 00:57 -0400
          Re: NaN comparisons - Call For Anecdotes Steven D'Aprano <steve@pearwood.info> - 2014-07-09 06:43 +0000
            Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-09 16:52 +1000
        Re: NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-09 17:08 +0200
          Re: NaN comparisons - Call For Anecdotes Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-07-09 16:53 +0000
            Re: NaN comparisons - Call For Anecdotes Ian Kelly <ian.g.kelly@gmail.com> - 2014-07-09 11:26 -0600
            Re: NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-09 19:44 +0200
        Re: NaN comparisons - Call For Anecdotes Chris Angelico <rosuav@gmail.com> - 2014-07-10 01:13 +1000
        Re: NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-09 18:24 +0200
    Re: NaN comparisons - Call For Anecdotes "Anders J. Munch" <2014@jmunch.dk> - 2014-07-08 21:25 +0200
  Re: NaN comparisons - Call For Anecdotes Rustom Mody <rustompmody@gmail.com> - 2014-07-09 20:07 -0700

csiph-web