V3 PATCH: numeric_limits<> support, fix PR/3865

Gabriel Dos Reis gdr@integrable-solutions.net
Tue Sep 3 09:27:00 GMT 2002


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



More information about the Libstdc++ mailing list