This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: V3 PATCH: numeric_limits<> support, fix PR/3865
Richard Henderson <rth@redhat.com> writes:
[...]
| Anyway, I was thinking about how to define your booleans. Seems like
| the following would work:
|
| bool has_infinity = __builtin_huge_val() / 2 == __builtin_huge_val();
| bool has_qnan = __builtin_nan("") != __builtin_nan("");
| bool has_snan = has_qnan;
The above seems to imply that if the system supports a QNaN then, it
also supports SNaN. Is that the case for all the plateform GCC supports?
What if -fno-signaling-nan is specified?
-- Gaby