Re: sign(real, 0/0), NaN vs ????????, and trapping

From: James Giles (jamesgiles_at_worldnet.att.net)
Date: 01/24/04


Date: Sat, 24 Jan 2004 01:08:25 GMT

Benjamin wrote:
> Hi everyone,
>
> I find it curious that the following
>
> sign(3.0,0.0/0.0)
> returns -3.0
>
> and
>
> sign(3.0,-0.0/0.0)
> returns 3.0
>
> Is 0.0/0.0 "negative"?

The Fortran Standard doesn't say (dividing by zero is non-standard).
The IEEE Standard requires the sign of the result of a divide to be
the exclusive-or of the signs of the operands, but it also makes a
special point of stating that no significance is attached to the
sign of a NaN. Some implementations may treat the sign bit as
the distinction between signalling NaNs and non-signaling NaNs.
I don't know what Intel uses it for.

-- 
J. Giles