rest25/library/fpectl.rst => rest262/library/fpectl.rst
4
5.. module:: fpectl
6   :platform: Unix
7   :synopsis: Provide control for floating point exception handling.
8.. moduleauthor:: Lee Busby <busby1@llnl.gov>
9.. sectionauthor:: Lee Busby <busby1@llnl.gov>
10
11
n12+.. note::
13+ 
14+   The :mod:`fpectl` module is not built by default, and its usage is discouraged
15+   and may be dangerous except in the hands of experts.  See also the section
16+   :ref:`fpectl-limitations` on limitations for more details.
17+ 
12.. index:: single: IEEE-754
13
n14-Most computers carry out floating point operations in conformance with the so-
n20+Most computers carry out floating point operations in conformance with the
15-called IEEE-754 standard. On any real computer, some floating point operations
21+so-called IEEE-754 standard. On any real computer, some floating point
16-produce results that cannot be expressed as a normal floating point value. For
22+operations produce results that cannot be expressed as a normal floating point
17-example, try ::
23+value. For example, try ::
18
19   >>> import math
20   >>> math.exp(1000)
21   inf
22   >>> math.exp(1000) / math.exp(1000)
23   nan
24
25(The example above will work on many platforms. DEC Alpha may be one exception.)
81     [ more output from test elided ]
82   >>> import math
83   >>> math.exp(1000)
84   Traceback (most recent call last):
85     File "<stdin>", line 1, in ?
86   FloatingPointError: in math_1
87
88
t95+.. _fpectl-limitations:
96+ 
89Limitations and other considerations
90------------------------------------
91
92Setting up a given processor to trap IEEE-754 floating point errors currently
93requires custom code on a per-architecture basis. You may have to modify
94:mod:`fpectl` to control your particular hardware.
95
96Conversion of an IEEE-754 exception to a Python exception requires that the
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op