How to distinguish different types of NaN float in Python
问题 I'm writing Python 2.6 code that interfaces with NI TestStand 4.2 via COM in Windows. I want to make a "NAN" value for a variable, but if I pass it float('nan') , TestStand displays it as IND . Apparently TestStand distinguishes between floating point "IND" and "NAN" values. According to TestStand help: IND corresponds to Signaling NaN in Visual C++, while NAN corresponds to QuietNaN That implies that Python's float('nan') is effectively a Signaling NaN when passed through COM. However, from