Originally posted by jplauril
According to http://tinyurl.com/bvczc we need to install an exception handler to handle attempting arithmetic with NaN's:
Unfortunately this fix will not make it to the next release.
Here is a workaround with "CSPyInterpreter" which you can use for the time being:
1) Embed the interpreter in your native C++ application;
2) Install an exception handler to your native application (in the thread where you create the "CSPyInterpreter" instance).
Check these threads:
http://discussion.forum.nokia.com/fo...threadid=55828
http://discussion.forum.nokia.com/fo...threadid=58377
Adding the exception handler, see this link:
http://www3.symbian.com/faq.nsf/0/A1...B?OpenDocument
So, these lines will be needed:
Handler:
Code:
static void handler(TExcType /*aType*/)
{
// do nothing
}
and adding it:
Code:
RThread().SetExceptionHandler(handler,KExceptionFpe);
Will result in 6600:
Code:
Python 2.2.2 (#0, Jun 28 2005, 14:26:52)
[GCC 2.9-psion-98r2 (Symbian build 546)] on symbian_s60
Type "copyright", "credits" or "license" for more information.
Type "commands" to see the commands available in this simple line editor.
>>> import math
>>> lat = 0.0
>>> lon = 0.0
>>> math.atan2(lat,lon)
NaN
>>> 360.0*math.atan2(lat,lon)
NaN
>>>