Message-ID: <33A9841B.5BC7@cs.com> Date: Thu, 19 Jun 1997 19:10:19 +0000 From: "John M. Aldrich" Reply-To: fighteer AT cs DOT com Organization: Two pounds of chaos and a pinch of salt MIME-Version: 1.0 To: DJGPP Workers Mailing List Subject: Possible bug in 'cin' support for long double. Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Precedence: bulk [Submitted as bug report #000162] 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 int main( void ) { long double x; cout << "x = "; cin >> x; cout << "\nYou 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. Any ideas? -- --------------------------------------------------------------------- | John M. Aldrich | "It may be better to be a live jackal| | aka Fighteer I | than a dead lion, but it is better | | mailto:fighteer AT cs DOT com | still to be a live lion." | | http://www.cs.com/fighteer | - Lazarus Long | ---------------------------------------------------------------------