NaN comparisons - Call For Anecdotes

Ethan Furman ethan at
Tue Jul 8 22:03:08 CEST 2014

On 07/08/2014 12:50 PM, Ian Kelly wrote:
> On Tue, Jul 8, 2014 at 1:16 PM, Ethan Furman <ethan at> wrote:
>> 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?
> The math module functions raise exceptions instead of returning NaN.

Ah, so if actual numbers go in, either actual numbers come out or an exception is raised -- good to know, and thanks for 


More information about the Python-list mailing list