This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::numeric_limits::is_iec559
Roberto Bagnara <bagnara@cs.unipr.it> writes:
| Gabriel Dos Reis wrote:
| > Roberto Bagnara <bagnara@cs.unipr.it> writes:
| > | I have always used std::numeric_limits::is_iec559 thinking that,
| > | as per the C++ standard, it yielded "[t]rue if and only if the type
| > | adheres to IEC 559 standard."
| > | | On a Mac OS X 10.4 machine with GCC 4.0.1, however, I get the
| > value
| > | true for long doubles but, as far as I can tell, the layout of
| > | long doubles there does not conform to the 128-bit format specified
| > | by IEC 559.
| > I don't follow. Exactly in what aspect do you believe the Mac OS X
| > 10.4 representation is not conformant to IEC 559?
|
| From your question I gather that IEC 559 does not specify a binary
| format for 128-bit numbers.
Well, first the formats specified by IEC 559 are abstract mathematical
models, not exact hardware representations. For example, HP has a bit
inverted fro NaNs, but the external semantics are preserved. That
does not prevent HP's representation to be conformant.
Second, long double formats are essentially left unspecified.
So, I suspect that your message was triggered because you came across
some non-conformant behaviour and I was wondering exactly which
behaviour -- to aid investigation.
-- Gaby