NaN comparisons - Call For Anecdotes

Ethan Furman ethan at stoneleaf.us
Tue Jul 8 15:16:47 EDT 2014


On 07/08/2014 12:04 PM, Anders J. Munch wrote:
> Ethan Furman skrev:
>
>> What exception? Apparently your claims about NaN in Python are all wrong -- have you been using a custom interpreter?
>> >>> float('inf') - float('inf')
>> nan
>
> If you deliberately try to manufacture NaN's, you can. I never said otherwise.

What you said is: "They just don't appear in normal computation, because the
interpreter raises an exception instead."

I just ran a calculation that created a NaN, the same as 4 - 3 creates a 1, and no exception was raised.

Do you have an example where one is?

--
~Ethan~



More information about the Python-list mailing list