This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: V3 PATCH: numeric_limits<> support, fix PR/3865
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Gabriel Dos Reis <gdr at integrable-solutions dot net>, <gcc-patches at gcc dot gnu dot org>, <libstdc++ at gcc dot gnu dot org>, Ulrich Drepper <drepper at redhat dot com>
- Date: Tue, 3 Sep 2002 17:47:16 -0600 (MDT)
- Subject: Re: V3 PATCH: numeric_limits<> support, fix PR/3865
On Tue, 3 Sep 2002, Richard Henderson wrote:
> On Tue, Sep 03, 2002 at 11:57:46AM -0600, Roger Sayle wrote:
> > bool has_snan = !(__builtin_snan("") == 0.0);
>
> If -fsignaling-nan, this ought to result in sigfpe.
> Thus you can't do that.
Is there any agreement on evaluating constant expressions containing
signaling NaNs at compile time. I agree that if the above statement
where executed at run-time I'd expect a SIGFPE, but as an initializer
to a global constant?
> > Otherwise I agree that we might also need __builtin_has_snan{,f,l} to
> > determine whether we support signaling NaNs.
>
> There's two questions of "support". (1) Can we represent the value,
> and (2) do we conserve signals. I suspect that std::numeric_limits
> only cares about question 1, and not about question 2.
Good point.
Roger
--