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


Groups > comp.lang.python > #74262

Re: NaN comparisons - Call For Anecdotes

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!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.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; '64-bit': 0.07; 'float': 0.07; 'anders': 0.09; 'converted': 0.09; 'input,': 0.09; 'add,': 0.16; 'bitwise': 0.16; 'comparisons,': 0.16; 'display,': 0.16; 'integer.': 0.16; 'nans': 0.16; 'stuff.': 0.16; 'saying': 0.22; 'to:name:python-list@python.org': 0.22; 'header:User-Agent:1': 0.23; 'compare': 0.26; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'chris': 0.29; 'received:dk': 0.31; 'steven': 0.31; 'them?': 0.31; 'anyone': 0.31; 'everyone': 0.33; 'becomes': 0.33; 'usual': 0.35; 'really': 0.36; 'doing': 0.36; 'charset:us-ascii': 0.36; "i'll": 0.36; 'should': 0.36; 'step': 0.37; 'being': 0.38; 'easiest': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'header:Return-path:1': 0.60; 'simple': 0.61; 'further': 0.61; 'different': 0.65; 'strategies': 0.77; 'subject:For': 0.78; 'employ': 0.93
Date Wed, 09 Jul 2014 18:24:46 +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> <53BD5ADF.2050409@jmunch.dk> <CAPTjJmr_d2f2CbFNOk4Osp9jhz=FskBi-LtDvAftGX2zrgLW1w@mail.gmail.com>
In-Reply-To <CAPTjJmr_d2f2CbFNOk4Osp9jhz=FskBi-LtDvAftGX2zrgLW1w@mail.gmail.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.11697.1404923089.18130.python-list@python.org> (permalink)
Lines 17
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1404923089 news.xs4all.nl 2880 [2001:888:2000:d::a6]:41314
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:74262

Show key headers only | View raw


Chris Angelico:
> If you need to do bitwise comparisons, then the easiest way is to use
> the bitpattern, converted to an integer. A 64-bit float becomes a
> 64-bit integer. It's then very simple to compare them, and reflexivity
> is maintained. At what point do you actually need them to be floats?
> What are you really doing with them?

What does one do with floats? Add, subtract, multipy, divide, display, input, 
store and retrieve to and from various formats.
All the usual stuff. Why would my use be different from anyone elses?

What you and Steven seem to be saying is that I should employ strategies to 
avoid NaNs ever being compared. I'll take that one step further and say that as 
long as NaN!=NaN, everyone should seek to avoid NaNs ever being compared.

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