test for nan

John Hunter jdhunter at ace.bsd.uchicago.edu
Thu Apr 1 08:11:19 EST 2004


>>>>> "Michael" == Michael Hudson <mwh at python.net> writes:

    Michael> This will work with 2.3 on Windows (I believe), current
    Michael> CVS on Windows (if compiled with VC7.1), current CVS on
    Michael> Linux (assuming an even vaguely recent gcc), but not
    Michael> current CVS on Windows compiled with VC6, nor Python 2.3
    Michael> on Linux/gcc.  Confused yet?

Fortunately I only need linux for this particular app, so I can use
one of the platform dependent solutions, but the bevy of proposed
solutions and gotchas have definitely been interesting.

Out of curiosity, are there any platforms where this is known to fail?

  def is_nan(x):
      return str(x).lower().find('nan')>=0

JDH




More information about the Python-list mailing list