Setting up a given processor to trap IEEE-754 floating pointerrors currently requires custom code on a per-architecture basis.You may have to modifyfpectl to control your particular hardware.
Conversion of an IEEE-754 exception to a Python exception requiresthat the wrapper macrosPyFPE_START_PROTECT andPyFPE_END_PROTECT be inserted into your code in an appropriatefashion. Python itself has been modified to support thefpectl module, but many other codes of interest to numericalanalysts have not.
Thefpectl module is not thread-safe.
See Also:
Some files in the source distribution may be interesting in learning more about how this module operates. The include fileInclude/pyfpe.h discusses the implementation of this module at some length.Modules/fpetestmodule.c gives several examples of use. Many additional examples can be found inObjects/floatobject.c.