> ksh93 is a POSIX conform shell, this includes C99 conform arithmetic
> expressions in shell arithmetic expressions, i.e. (( expression )).

If ksh93 arithmetic expressions were truly C99 conforming,
then ((x == nan)) would *never* be true, because a NaN
is not equal to any number, including itself.  In fact, in
C99, one uses either isnan(x) or the expression (x != x)
to check if x is a NaN.

> I don't know whether the difference between SPARC and i386
> is a bug in i386 or the standard undefined. This should be
> investigated by the compiler team.

On Intel, the default NaN generated by hardware from non-NaN
operands (such as 0./0.) has its sign bit on.

On SPARC, the default NaN generated by hardware from non-NaN
operands (such as 0./0.) has its sign bit off.

The IEEE 754 Standard does not specify the bit pattern of
the default NaN generated by hardware/software.
-- 
This message posted from opensolaris.org
_______________________________________________
tools-compilers mailing list
[email protected]

Reply via email to