Is this a STLport bug

A

Aman JIANG

vc8 + STLport 5.1.3:

cout << fixed << numeric_limits<double>::max();

It result a runtime error.
 
V

Victor Bazarov

Aman said:
vc8 + STLport 5.1.3:

cout << fixed << numeric_limits<double>::max();

It result a runtime error.

Have you tried debugging it? I don't have STLport (nor do I
intend to use it) but it should be fairly easily to step into
the operator<<, I would think... VC++ has a very good debugger
it would be a shame not to use it...

V
 
B

BobR

Victor Bazarov wrote in message...
Have you tried debugging it? I don't have STLport (nor do I
intend to use it) but it should be fairly easily to step into
the operator<<, I would think... VC++ has a very good debugger
it would be a shame not to use it...

It has nothing to do with STL/Standard C++ Lib. It's a bug in MSVCRT.DLL.

The biggest number you can print out (directly) on window$ in 'fixed' format
is:

double tmp( std::numeric_limits<double>::max() / 1.0e+276 );
std::cout << std::fixed << tmp;

Change that magic-number to '275' and BANG.

The whole '*.max()' will print on GNU/Linux (and probably others).

[ those were my findings on an Pentium4/win98se/GCC(MinGW)3.3.1. ]
 
A

Aman JIANG

Victor Bazarov wrote in message...
Have you tried debugging it? I don't have STLport (nor do I
intend to use it) but it should be fairly easily to step into
the operator<<, I would think... VC++ has a very good debugger
it would be a shame not to use it...

It has nothing to do with STL/Standard C++ Lib. It's a bug in MSVCRT.DLL.

The biggest number you can print out (directly) on window$ in 'fixed' format
is:

double tmp( std::numeric_limits<double>::max() / 1.0e+276 );
std::cout << std::fixed << tmp;

Change that magic-number to '275' and BANG.

The whole '*.max()' will print on GNU/Linux (and probably others).

[ those were my findings on an Pentium4/win98se/GCC(MinGW)3.3.1. ]

Thank you.
But if I use vc8's STL it will works fine :(
 
A

Aman JIANG

Have you tried debugging it? I don't have STLport (nor do I
intend to use it) but it should be fairly easily to step into
the operator<<, I would think... VC++ has a very good debugger
it would be a shame not to use it...

V

Thank you.
My question was just about the bug, and was there a bug,
but not about debug.
 
G

Guest

vc8 + STLport 5.1.3:

cout << fixed << numeric_limits<double>::max();

It result a runtime error.

It works just fine if you use the STL that comes with VS, so the bug
must be with STLPort, for more information ask in a group discussing
STLPort.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,651
Latest member
VeraPiw932

Latest Threads

Top