This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: std::numeric_limits::is_iec559
Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
> 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?
It isn't conformant because the basic arithmetic is different. Even
though the 'doubled double' format has infinities, denormals, and so on,
it's not IEC559 compliant.
(I find it necessary, every time I say something like the above, to point
out that it is compliant with a number of other standards including C99
and C++03, so that people don't assume that it's completely strange.)
I think round_error() is also wrong; it should be 3.0 (see
gcc/config/rs6000/darwin-ldouble-format), but I'm not completely sure,
you'd have to look at the exact wording of LIA-1. (It should also
probably not be inline, in case the library routines get improved
later.)