[RFA:] fix 27_io/basic_ostream/inserters_arithmetic/char/4402.cc

Paolo Carlini pcarlini@suse.de
Fri Mar 23 12:07:00 GMT 2007


Hi Hans-Peter

and thanks for looking into this.

>   // make sure we can output a very long float
>+#if LDBL_MAX_10_EXP > 1000
>   long double val = 1.2345678901234567890123456789e+1000L;
>+#elif LDBL_MAX_10_EXP > 200
>+  long double val = 1.2345678901234567890123456789e+200L;
>+#elif LDBL_MAX_10_EXP > 30
>+  long double val = 1.2345678901234567890123456789e+30L;
>+#else
>+#error "Unreasonable limits for a long double."
>+#endif
>  
>
instead of guessing like this basing on <cfloat>, could we just use 
something like:

    int exp = std::numeric_limits<long double>::max_exponent10 - 2;
    long double val = std::pow(1.2345678901234567890123456789L, exp);

and similarly for the double val2 below?

Thanks,
Paolo.



More information about the Libstdc++ mailing list