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

Tim Peters tim.one at comcast.net
Mon Mar 4 19:58:52 EST 2002


[Paul Rubin]
> 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.

Cool!  Thanks for the info.  It's been recorded as a comment attached to

<http://sf.net/tracker/?func=detail&atid=105470&aid=525705&group_id=5470>

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

I don't know of any high level language that does in a portable way.  If
vendors choose to implement the optional 754 gimmicks in C99, then such
vendors' C99 implementations will come close.  Short of that, you have to
dig thru your favorite language+vendor+platform combo's extensions.





More information about the Python-list mailing list