V3 PATCH: numeric_limits<> support, fix PR/3865
Zack Weinberg
zack@codesourcery.com
Mon Sep 2 14:10:00 GMT 2002
On Mon, Sep 02, 2002 at 12:39:40PM -0700, Ulrich Drepper wrote:
> >>I suppose we could define "snan" (case insensitive) to do what we
> >>want. I'd bet that Uli would be willing to pick this up for glibc's
> >>strtod implementation. We'd probably be "inconsistent" with other
> >>libcs, but in an extremely minor way.
> >
> >
> >It might make sense to permit entry of infinity and NaN as hexadecimal
> >floating constants. I could go two ways on that:
>
> That would be good but we have a standard way of writing this for nans.
> I'd rather see this mathod extended:
>
> __builtin_nan ("...")
> __builtin_qnan ("...")
> __builtin_snan ("...")
> __builtin_inf ()
>
> This has the benefit of never going to clash with additions which might
> be added to ISO C or C++.
And would also be easier to implement (the string->float code is
rather fragile). I like this idea.
zw
More information about the Libstdc++
mailing list