> I've chased this problem down to the MS Windows 2.4.3 version of Python. In > this version, attempting the operation NaN**2 fails with a ValueError. In > the Python 2.4.1 in Linux, NaN**2 = NaN! I'm not sure if this is the Python > version number or the Windows Python version which is problematic. As this > bug should never be encountered by a user (it only occurs when the global > correlation time and internal correlation time are both zero) and will > probably be fixed in future Windows Python versions, I am closing the bug > report. I am not going to attempt a fix for the problem because the problem > lies in the Windows Python executables.
As Python's floating-point behaviour is generaly inherited from the underlying C machinery, this is almost certainly a 'feature' of whatever C compiler was used to build the windows Python version. Don't hold your breath for a fix - the powers that be in the Python world are in no hurry to change this (because building a fast, robust and platform independent fp machinery is a truly massive task, and they have better things to do with their time). I can't see MS being in any rush to change their compiler's behaviour either.
Unfortunately that's not something we are in a position to fix. Attempting to catching it is probably not much use considering how the problem arises. Even more so if the code where the error occurs, the functions within the 'math_fns' directory, are converted to C!
I agree though, that this is not a big issue in the current context. If it appears in a more serious context, we will have to catch the situation before the ValueError is thrown in order to at least give the user a meaningful error message.
Definitely. Hopefully no one ever encounters it though. However if someone does, we have Gary's floating point tests ready to catch it. I will probably need to modify the test from the test suite which trips the problem to either avoid it or catch it with a 'try' statement.
Edward