2) there is an external module called fpconst which supplies similar functionality. This relies on the python struct module to compare the underlying bit sequence with the IEEE 754 standards. It seems to work well on my machine, and I think most platforms should be compliant at that level, but I'm not sure and I have limited opportunity to test other platforms. On the up side the module is relatively small, and could be incorporated into relax, so it need not be a dependency (its under the Apache Licence).
Would this module be useful for NaNs generated by the current code? Does it replace the inbuilt Python NaNs with it's own NaNs? The module's web page seems to be down at the moment.
Edward