Numerics, NaNs, IEEE 754 and C99

Nick Maclaren nmm1 at
Thu Jun 15 18:44:09 CEST 2006

In article <129300g5np02c8a at>,
Grant Edwards <grante at> writes:
|> > which IEEE 754 assumes that the code will test and take
|> > appropriate action (which can be anything, including aborting
|> > the program and replacing it by a NaN). See
|> >
|>   IEEE Std 754-1985, subclause 7.2 - Division by Zero
|>     "If the divisor is zero and the dividend is a finite nonzero
|>      number, then the division by zero shall be signaled. The
|>      result, when no trap occurs, shall be a correctly signed
|>      (infinity symbol)(6.3)."
|> To me it looks like the spec specifically allows for a case
|> where "no trap occurrs" and the result is Inf.

That is correct.  And it is a mandatory case.  But it does NOT say what
the software should then do with the exception.

Nick Maclaren.

More information about the Python-list mailing list