This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] Further HONOR_[S]NANS improvements.
Richard Henderson <rth@redhat.com> writes:
| On Thu, Aug 01, 2002 at 09:48:58PM +0200, Gabriel Dos Reis wrote:
| > However within in the scope of LIA-1, there is no possibility to
| > distinguish -0 from +0.
|
| It's certainly possible with copysign(3).
But, copysign() is not part of LIA-1.
The LIA-1 specification doesn't define two zeros -- see 5.2. and 5.2.9
When iec_559 is true, all operations and values common to this part
of ISO/CEI 10967 and IEC 559 shall satisfy the requirements of both
standards. Values present only in IEC 559 (-0, -Inf, +Inf and the
NaNs) need only satisfy the requirements of IEC 559. The value set
F as used in the definitions and axioms of 5.2 does not contain
these extra values - it only contains the common values. Thus, the
axioms in 5.2.7 apply only to common values. Nevertheless, the
operations in 5.2.2 shall not distinguish -0 from +0.
The Rationale (A.5.2.0.5) goes on saying:
[...] Even in the IEEE implementation, the two encodings of zero
can only be distinguished with operation that are not provided in
LIA-1, e.g. use of the IEEE copysign function, dividing by zero to
obtain a signed infinity, or (possibly) converting to a decimal
string. [...]
-- Gaby