www.delorie.com/djgpp/bugs/show.cgi   search  
Bug 000162

When Created: 06/19/1997 19:14:31
Against DJGPP version: 2.01
By whom: fighteer@cs.com
Abstract: 'cin' does not correctly input long doubles.
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.

Note added: 04/13/1999 07:00:08
By whom: eliz@is.elta.co.il
This is a bug in the GNU iostream library, it is not a DJGPP bug.

Closed on 04/13/1999 07:00:48: A bug in the GNU iostreams library, not a DJGPP bug.
By whom: eliz@is.elta.co.il



  webmaster     delorie software   privacy  
  Copyright © 2010   by DJ Delorie     Updated Jul 2010