This is a followup to a user's post on the newsgroup regarding problems
reading and writing long doubles in C++ programs. I asked her to send
me sample code, which I include here:
#include <iostream.h>
int main( void )
{
long double x;
cout << "x = ";
cin >> x;
cout << "
You entered " << x << endl;
return 0;
}
When this code is run, it results in either a NaN or a SIGFPE in the
cout statement. Further work traced it to the cin statement, since
replacing this with scanf( "%Lf", &x ); makes the code work correctly.
There is no current bug report about this, nor any information in the
mailing list archives or the docs for iostream.h.