By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,587 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,587 IT Pros & Developers. It's quick & easy.

fpectl

P: n/a
Hi all,

Can anybody tell me why I can't load the fpectl module in my Python
interpreter:
import fpectl

Traceback: ...
....
ImportError: No module named fpectl

My platform is Linux (Mandrake 10.x) + Python2.4, built from the
(python.org) sources and configured with the --with-fpectl option.

Any idea ? Is the Python Library Reference obsolete on this point or
did I miss something ?

I have understood from the previous posts on the subject that the whole
floating-point issue (or specifically IEEE 754 support) is quite
complex
and highly platform-dependent. Therefore I guess that I cannot take for
granted the expected behavior of fpectl functions. But at least I
should
be able to import it, shouldn't I ?

Cheers,

S.B.

Jul 19 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a

Sébastien Boisgérault wrote:
Hi all,

Can anybody tell me why I can't load the fpectl module in my Python
interpreter:
import fpectl
Traceback: ...
...
ImportError: No module named fpectl

My platform is Linux (Mandrake 10.x) + Python2.4, built from the
(python.org) sources and configured with the --with-fpectl option.

Any idea ? Is the Python Library Reference obsolete on this point or
did I miss something ?

I have understood from the previous posts on the subject that the

whole floating-point issue (or specifically IEEE 754 support) is quite
complex
and highly platform-dependent. Therefore I guess that I cannot take for granted the expected behavior of fpectl functions. But at least I
should
be able to import it, shouldn't I ?

Cheers,

S.B.


I'd assume it's because you're on a non-Unix system. The docs
(http://www.python.org/doc/2.3.5/lib/module-fpectl.html) say:
Availability: Unix

I'm assuming that means you can't use it on a Windows platform (or any
non-Unix environment)...

Jul 19 '05 #2

P: n/a
Matt wrote:
Sébastien Boisgérault wrote:
My platform is Linux (Mandrake 10.x)

I'm assuming that means you can't use it on a Windows platform

It's harsh to say Mandrake is a Windows platform. ;o)
Jul 19 '05 #3

P: n/a
It looks like the automatic build of the 'fpectl' module was broken
somewhere along the line, perhaps when the transition from Modules/Setup
to setup.py took place.

Once I made the change below and rebuilt, I got the fpectl module.
Furthermore, it appeared to "do something" on my Linux/x86 system:

$ ./python -c '1e200 ** 6'
OverflowError: (34, 'Numerical result out of range')
$ ./python -c 'import fpectl; print dir(fpectl); fpectl.turnon_sigfpe(); 1e200 ** 6'
['__doc__', '__file__', '__name__', 'error', 'turnoff_sigfpe', 'turnon_sigfpe']
Fatal Python error: Unprotected floating point exception
Aborted

Jeff
Index: setup.py
================================================== =================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.217
diff -u -u -r1.217 setup.py
--- setup.py 15 Apr 2005 20:32:39 -0000 1.217
+++ setup.py 19 Apr 2005 00:13:15 -0000
@@ -400,6 +400,8 @@
# select(2); not on ancient System V
exts.append( Extension('select', ['selectmodule.c']) )

+ exts.append( Extension('fpectl', ['fpectlmodule.c']) )
+
# The md5 module implements the RSA Data Security, Inc. MD5
# Message-Digest Algorithm, described in RFC 1321. The
# necessary files md5c.c and md5.h are included here.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)

iD4DBQFCZE3RJd01MZaTXX0RAi0UAJdRBueXae2l60l1N+MiHN z5jlAzAKCGCN5Y
p9FKoAck9cS/eBHzFL1iLQ==
=dVFi
-----END PGP SIGNATURE-----

Jul 19 '05 #4

P: n/a
Thanks for this answer.

Did you forward this info to python-dev ?

Cheers,

SB

Jul 19 '05 #5

P: n/a
On Tue, Apr 19, 2005 at 02:05:11AM -0700, Sébastien Boisgérault wrote:
Thanks for this answer.

Did you forward this info to python-dev ?


I created a patch on the sf tracker. It's been responded to by several
developers. You can read what they said there.

http://python.org/sf/1185529

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQFCZTKjJd01MZaTXX0RAtjCAJ47jgVwy4LLWNQjUeFdMH UCDljB9QCfVL0l
96A4zH2fVyU4JhIishdtqik=
=FnOA
-----END PGP SIGNATURE-----

Jul 19 '05 #6

P: n/a

Good ! And thanks for the link. I had not noticed the warning "fpectl
module is dangerous" before.

I am a bit sad that the floating-point issue is disappearing from the
*active topics* list ...

Cheers,

SB

Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.