[EMAIL PROTECTED] > my python 2.3.4 for windows refuse to execute line float("NaN"). It > says: > > >>> float("NaN") > Traceback (most recent call last): > File "<stdin>", line 1, in ? > ValueError: invalid literal for float(): NaN > > The same line works as expected on Linux and Solaris with python 2.3.4. > Could anybody explain what is possibly wrong here? is it bug or > feature?
Neither -- all Python behavior in the presence of float NaNs, infinities, or signed zeroes is a platform-dependent accident. In this specific case, the accident is that the platform C runtime string->double functions on your Linux and Solaris boxes recognize "NaN", but Microsoft's string->double functions do not. Microsoft's libraries can't even read back the strings they *produce* for NaNs.(usually "-1.#IND"). -- http://mail.python.org/mailman/listinfo/python-list