GNU Info

Info Node: (python2.1-lib.info)Example 2

(python2.1-lib.info)Example 2


Next: Limitations and other considerations Prev: fpectl Up: fpectl
Enter node , (file) or (file)node

Example
-------

The following example demonstrates how to start up and test operation of
the `fpectl' module.

     >>> import fpectl
     >>> import fpetest
     >>> fpectl.turnon_sigfpe()
     >>> fpetest.test()
     overflow        PASS
     FloatingPointError: Overflow
     
     div by 0        PASS
     FloatingPointError: Division by zero
       [ more output from test elided ]
     >>> import math
     >>> math.exp(1000)
     Traceback (most recent call last):
       File "<stdin>", line 1, in ?
     FloatingPointError: in math_1


automatically generated by info2www version 1.2.2.9