fpectl

  • Thread starter =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
  • Start date
?

=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

Hi all,

Can anybody tell me why I can't load the fpectl module in my Python
interpreter:
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.
 
M

Matt

Sébastien Boisgérault said:
Hi all,

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

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)...
 
J

Jeff Epler

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+MiHNz5jlAzAKCGCN5Y
p9FKoAck9cS/eBHzFL1iLQ==
=dVFi
-----END PGP SIGNATURE-----
 
?

=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

Thanks for this answer.

Did you forward this info to python-dev ?

Cheers,

SB
 
J

Jeff Epler

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)

iD8DBQFCZTKjJd01MZaTXX0RAtjCAJ47jgVwy4LLWNQjUeFdMHUCDljB9QCfVL0l
96A4zH2fVyU4JhIishdtqik=
=FnOA
-----END PGP SIGNATURE-----
 
?

=?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,134
Latest member
Lou6777736
Top