E
Eric Sosman
Dan said:In said:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Not "the high-order bits of the resulting value," but
"the resulting value, period."
[...]
Wrong. You have no licence to ignore the first statement of the
paragraph, which is limiting the options of the implementor.
It is a wilful (probably) misreading of the Standard
to maintain that the first sentence invalidates the other
two. Consider the similar construction in 7.12.7.5:
The sqrt functions compute the nonnegative
square root of x. A domain error occurs if
the argument is less than zero.
If the first sentence is taken to be inviolable, as you
suggest in the case of right-shift, then sqrt() must compute
a non-negative square root for *every* argument value, even
negative values. This is, of course, nonsense -- so it
follows that the first sentence *can* be ignored under the
circumstances described in the rest of the paragraph.
"The value is implementation-defined" means what it
says: The implementation has complete freedom to produce
any value it chooses, so long as it documents the choice.
See also 3.17.1 and 3.17.3.