J3/04-422
Date: 10th November 2004
To: J3
From: Malcolm Cohen
Subject: Interpretation request on negative zero and intrinsics
NUMBER: F03/0029
TITLE: Negative zero and intrinsic functions
KEYWORDS: Negative zero, IEEE, intrinsic functions
DEFECT TYPE: Erratum
STATUS: Submitted
QUESTION:
4.4.2 states
"Processors that distinguish between positive and negative zeros
shall treat them as equivalent ... as actual arguments to intrinsic
procedures other than those for which it is explicitly specified that
negative zero is distinguished"
Q1. Does this mean that TRANSFER(-0.0,42) is required to give the same
answer as TRANSFER(+0.0,42)? The definition of TRANSFER has no
explicit mention of negative zero.
Q2. Does this mean that MERGE(+0.0,-0.0,flag) always returns +0.0?
Q3. Does this mean that SPREAD(-0.0,2) has the value [+0.0,+0.0]
instead of [-0.0,-0.0]?
Q4. Does this mean that RESHAPE([-0.0],[1]) has the value [+0.0]
instead of [-0.0]?
Q5. Does this mean that SET_EXPONENT(-0.0,10) is +0.0 not -0.0?
Q6. Does this mean that if a REAL variable X has a negative zero
value, REAL(x,...) has a positive zero value?
Q7. Does this mean that CMPLX(0,-0.0) has the value (+0.0,+0.0)
instead of (+0.0,-0.0)?
Q8. Does this mean that if a complex variable C has a negative zero
imaginary part, that AIMAG(C) returns +0.0 instead of -0.0?
Q9. In any other intrinsic function, if the definition of the
intrinsic would imply a different result for negative zero than
for positive zero, does this mean that the function returns the
positive zero answer for a negative zero argument?
ANSWER:
Q1. No. The definition of TRANSFER explicitly states that its result
has the same physical representation as its first argument. This
would not be possible if "equivalent" meant that the exact same
result had to be produced.
Q2. No, this would contradict the definition of MERGE.
Q3. No. SPREAD "replicates" its argument, which means that the value
of each copy is the same as the original, not just compare equal.
As with TRANSFER, this would not be possible with the suggested
interpretation of the text in 4.4.2.
Q4+. No. As with the previous questions, this would require an overly
strict interpretation of the term "equivalent", contradicting
the clear intent of the function in question.
DISCUSSION:
The term "equivalent" in the quoted text in 4.4.2 refers to the
concept of mathematical equivalence, not physical or computational
equivalence. A clarifying edit is supplied.
EDITS:
[38:2] Before "equivalent" insert "mathematically".
SUBMITTED BY: Malcolm Cohen
HISTORY: J3/04-422 m170 submitted