[ python-Bugs-872265 ] fpectl module needs updating

SourceForge.net noreply at sourceforge.net
Sat Jan 17 19:19:28 EST 2004


Bugs item #872265, was opened at 2004-01-07 05:32
Message generated for change (Comment added) made by tim_one
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=872265&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Steve Chaplin (stevech)
Assigned to: Nobody/Anonymous (nobody)
Summary: fpectl module needs updating

Initial Comment:
The fpectl module docs (Python Library Reference 3.4.2)
says
"Setting up a given processor to trap IEEE-754 floating
point errors currently requires custom code on a
per-architecture basis."

I think that is no longer accurate, we now have fenv.h,
which: 
- avoids the need for custom code, by using the
standard C99 header file
- should work on non-Unix and Unix systems

I think that the fpectl module could be rewritten and
greatly simplified using fenv.h
The Python module Numarray has done this and could be
used as an example.

----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2004-01-17 19:19

Message:
Logged In: YES 
user_id=31435

Note the NEWS file for 2.3 said

"""
- The fpectl module is not built by default; it's dangerous or 
useless except in the hands of experts.
"""

The fpectl module should die.  It certainly still requires custom 
code on a per-*platform* basis regardless, since most C 
compilers used to build Python predate C99.  If we could 
assume C99 (we can't, just thinking out loud), then a new 
module offering full access to 754's features should supplant 
fpectl (fpectl now has a very narrow view of the world).

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2004-01-17 19:03

Message:
Logged In: YES 
user_id=21627

Can you provide a patch? The tricky part is to ensure
backwards compatibility if you are fundamentally changing
the implementation strategy.

Also, what compilers on what architectures support fenv.h?
That it is part of C99 does not make it automatically
available on all systems.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=872265&group_id=5470



More information about the Python-bugs-list mailing list