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++, whileNAN
corresponds to QuietNaN
That implies that Python's float('nan')
is effectively a Signaling NaN when passed through COM. However, from what I've read about Signaling NaN, it seems that Signaling NaN is a bit "exotic" and Quiet NaN is your "regular" NaN. So I have my doubts that Python would be passing a Signaling NaN through COM. How could I find out if a Python float('nan')
is passed through COM as a Signaling NaN or Quiet NaN, or maybe Indeterminate?
Is there any way to make a Signaling NaN versus QuietNaN or Indeterminate in Python, when interfacing with other languages? (Using ctypes
perhaps?) I assume this would be a platform-specific solution, and I'd accept that in this case.
Update: In the TestStand sequence editor, I tried making two variables, one set to NAN
and the other set to IND
. Then I saved it to a file. Then I opened the file and read each variable using Python. In both cases, Python reads them as a nan
float.