[Numpy-discussion] RE: Python 2.2 seriously crippled for numerical computation?

Paul Rubin phr-n2002a at nightsong.com
Mon Mar 4 04:38:18 EST 2002


Tim Peters <tim.one at comcast.net> writes:

> A lot of this speculation should have been cut short by my first msg.
> 
> Yes, something changed in 2.2; follow the referenced link:
> 
> http://sf.net/tracker/?group_id=5470&atid=105470&func=detail&aid=496104
> 
> For the rest of it, it looks like the "1e-200**2 raises OverflowError"
> glitch is unique to platforms using glibc.  What isn't clear is whether it's
> dependent on which version of glibc, or on whether Python is linked
> with -lieee, or both.

I get the OverflowError under Red Hat 7.2 with the default Python 2.2 
build, which appears to not use -lieee.  The configure script's
test for __fpu_control in -lieee appears to never be run when
you type "configure".  I manually put "-lieee" into the LIBS=...
line in the makefile and rebuilt.  Now I get:

    [phr at localhost Python-2-2]$ ./python
    Python 2.2 (#2, Mar  4 2002, 01:31:37)
    [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> 1e-200**2
    0.0

so the behavior changes with -lieee.

> Unfortunately, the C standard (neither one) isn't a lick of help here --
> error reporting from C math functions is a x-platform crapshoot.

That seems to me to be a deficiency in the C standard--IEEE 754
defines these different error modes because they're all important, and
any high level language that claims to be good for serious numerics
should give precise control over the error modes.



More information about the Python-list mailing list