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

Richard Henderson rth@redhat.com
Tue Sep 3 02:43:00 GMT 2002


On Mon, Sep 02, 2002 at 02:30:12PM -0600, Roger Sayle wrote:
> http://std.dkuug.dk/JTC1/SC22/WG14/www/docs/n965.htm

Thanks.  Draft or not, it looks good enough to use.

> For my two cents, I support Ulrich that adding __builtin_nan,
> __builtin_qnan, __builtin_snan and __builtin_inf to GCC would be
> a convenient starting print, upon which glibc and libstdc++ could
> portably implement the functionality described in the above draft
> standard.

Actually, looking at all this again, I don't think __builtin_qnan
is appropriate.  C99 7.12.11.2/3 is quite explicit that nan/nanf/nanl
returns a quiet nan if available.

Thus I'll just go with __builtin_nan{,s}{,f,l}.

As for __builtin_inf(), on non-ieee targets, should this be more
like HUGE_VAL (return the largest value possible) or INFINITY
(which results in a diagnostic)?  Perhaps the later, and do go
ahead and supply a __builtin_huge_val() as well?


r~



More information about the Libstdc++ mailing list