ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
ActivePython 2.4
Python Documentation
Library Reference
3. Python Runtime Services
3.4 fpectl -- Floating point exception control
3.4.1 Example
3.4.2 Limitations and other considerations

MyASPN >> Reference >> ActivePython 2.4 >> Python Documentation >> Library Reference >> 3. Python Runtime Services >> 3.4 fpectl -- Floating point exception control
ActivePython 2.4 documentation


3.4.1 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

See About this document... for information on suggesting changes.

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved