Questions about NCEG

Paul Eggert eggert at twinsun.com
Tue Jun 5 12:48:08 AEST 1990


Patricia Shanahan writes:

	A truly logical high level language use of IEEE 754 would have to make
	explicit allowance for the possibility that "x > y" is neither true nor
	false, but meaningless because x and y are not ordered relative to each
	other.

In IEEE 754, x>y is always either true or false, and is never ``meaningless''.
A high level language can thus treat x>y like any other formula.
Granted, x>y differs from !(x<=y) when either x or y is not a number.

	... any attempt to extend high level languages to expose IEEE to the
	user program will have to be inconsistent ...

I hope that ``inconsistent'' here does not mean ``logically inconsistent'',
because then an implementation could not conform to both ANSI C and IEEE 754.
Instead it must mean something like ``inconsistent with what programmers
expect''.  Not everyone agrees.  Let us hope NCEG resolves this for C.

	... we use IEEE format floating point, but run by default with all
	infinity and NaN generating operations trapped, and treat both zero
	representations as being true zero.

This does not conform to IEEE 754, which distinguishes -0 from 0, and in which
``The default response to an exception shall be to proceed without a trap.''

Of course, implementers who feel strongly that a standard is wrong need not
conform to it, so long as they do not claim conformance.  Implementers can also
compromise by supplying compiler options that enable conformance, e.g. GCC's
-ansi and -pedantic options.



More information about the Comp.std.c mailing list