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

Jason Orendorff jason at jorendorff.com
Mon Mar 4 06:03:52 EST 2002


Paul Rubin wrote:
> Tim Peters <tim.one at comcast.net> writes:
> > 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.

To be fair, C99 goes on about this at great length in Annex F.
The error behavior appears to be specified pretty closely, to my
untrained eye, and all sorts of error-detecting and -handling
functions are provided in <fenv.h>.  (No idea what compliance is
like out there, though.)

But the standard leaves it to the implementation whether "underflow"
and "inexact" are reported in certain cases.  Interestingly,
the footnote blames the underflow lenience on IEEE:

    "IEC 60559 allows different definitions of underflow.  They all
    result in the same values, but differ on when the floating-point
    exception is raied."

Btw, I hereby disclaim all knowledge of what I'm talking about.
(As if there were any doubt.)

## Jason Orendorff    http://www.jorendorff.com/





More information about the Python-list mailing list