On Thu, Dec 14, 2006 at 08:43:48PM +0100, Andre Poenitz wrote:
> On Thu, Dec 14, 2006 at 01:28:38AM +0100, Enrico Forestieri wrote:
> > + iter_type
> > + do_put(iter_type oit, std::ios_base & b, char_type fill, double v) const
> > + {
> > + if (fill >= 0x80)
> > + throw num_put_failure();
> > +
> > + std::string s;
> > + // 64 is large enough
> > + s.resize(64);
>
> 640k is large enough for everybody...
That was "640K ought to be enough for everybody"...
> I am not sure in what context this will occur, but 64 can be beaten by
> anything similar to printf(double)
$ cat > showtoandre.C
#include <iostream>
#include <iomanip>
#include <float.h>
int main()
{
std::cout << '<' << std::setprecision(200) << LDBL_MAX << '>' << std::endl;
return 0;
}
^D
$ g++ showtoandre.C -o showtoandre
$ ./showtoandre
<1.189731495357231765021263853030970205169063e+4932>
64 is large enough...
--
Enrico