12-154r1
To: J3
From: Malcolm Cohen
Subject: Interp request: Are IEEE +0 and -0 distinguished
Date: 2012 June 28
----------------------------------------------------------------------
NUMBER: F08/0078
TITLE: Are the IEEE values +0 and -0 distinguished
KEYWORDS: IEEE, zero, IEEE_SUPPORT_DATATYPE
DEFECT TYPE: Clarification
STATUS: J3 consideration in progress
QUESTION:
Suppose the value of IEEE_SUPPORT_DATATYPE is true for arguments of
some kind type parameter values for a processor. Is the processor
required to distinguish between the real values +0 and -0 if the kind
type parameter value of those zeros is among the kind type parameter
values for which IEEE_SUPPORT_DATATYPE is true?
ANSWER:
No, the processor is not required to distinguish between positive and
negative zero.
DISCUSSION:
If IEEE_SUPPORT_DATATYPE is true, IEEE_COPY_SIGN is required to behave
differently with positive and negative zero representations; however
this is because the IEEE_COPY_SIGN function copies the "sign bit" of
the underlying representation, and in this it is acting in the same
manner as the TRANSFER intrinsic.
This means that even on a processor that does not distinguish between
positive and negative zero in the places where the Fortran standard
has different behaviour depending on that distinction (viz I/O and
the SIGN intrinsic), the processor can still provide the IEEE features
and the user can still access the IEEE copysign functionality using
the IEEE_COPY_SIGN function.
EDITS:
None.
SUBMITTED BY: Robert Corbett
HISTORY: 12-154 m198 Submitted
12-154r1 m198 Revised answer
----------------------------------------------------------------------