Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion a.index(float('nan')) fails
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Terry Reedy  
View profile  
 More options Oct 26 2012, 3:54 am
Newsgroups: comp.lang.python
From: Terry Reedy <tjre...@udel.edu>
Date: Fri, 26 Oct 2012 03:54:02 -0400
Local: Fri, Oct 26 2012 3:54 am
Subject: Re: a.index(float('nan')) fails
On 10/25/2012 10:44 PM, Steven D'Aprano wrote:

> On Thu, 25 Oct 2012 22:04:52 -0400, Terry Reedy wrote:

>> It is a consequence of the following, which some people (but not all)
>> believe is mandated by the IEEE standard.

>>   >>> nan = float('nan')
>>   >>> nan is nan
>> True

> The IEEE 754 standard says nothing about object identity. It only
> discusses value equality.

>>   >>> nan == nan
>> False

> IEEE 754 states that all NANs compare unequal to everything, including
> NANs with the same bit value. It doesn't make an exception for
> comparisons with itself.

> I'm not entirely sure why you suggest that there is an argument about
> what IEEE 754 says about NANs.

I did not do so.

> As far as I can see, the argument is
> whether or not language designers should pick and choose which bits of
> the standard they want to follow, thus taking a step backwards to the
> chaos of numerical computing prior to the IEEE 754 standard.

There has been disagreement about whether the standard mandates that
Python behave the way it does. That is a fact, but I have no interest in
discussing the issue.

--
Terry Jan Reedy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.