Questions about NCEG

Tim Olson tim at proton.amd.com
Wed Jun 6 07:26:32 AEST 1990


In article <8949 at celit.fps.com> ps at fps.com (Patricia Shanahan) writes:
| Incidentally, just as a matter of curiosity, if any of you have a copy of
| IEEE 754 handy, which does it say? Treat unordered comparisons as traps, 
| unless a special operator is used to handle them, or treat all unordered 
| relations as false.

The standard says that the result of a comparison shall be delivered
in one of two ways -- either as a condition code identifying one of:

	less than
	equal to
	greater than
	unordered

or as a true-false response to a comparison predicate.  In the later
case, if one or both of the operands is unordered, then the predicate
returns the value defined in the spec (mostly "false", but not-equal
(!=) would return "true"), and most predicates also signal an invalid
operand exception.

Whether this exception causes a trap or simply sets a "sticky" status
bit depends upon whether traps have been enabled or not for the
invalid operand exception.

	-- Tim Olson
	Advanced Micro Devices
	(tim at amd.com)



More information about the Comp.std.c mailing list