A problem with cin or strtod?
Joseph S. Myers
jsm28@cam.ac.uk
Fri Feb 9 10:53:00 GMT 2001
On 9 Feb 2001, Daniel P. Katz wrote:
> I ran into a problem where (cin >> x) for double x reads in
> NaN as a double, even though this seems not to be in accordance with
> the C++ standard. It seems to me that the problem is either with cin
> (in g++) or strtod(3) (in glibc), and since I don't have the C and C++
> standards in front of me, I'm not quite sure which of them is the
> problematic element. Therefore, I am sending this to the bug streams
> for both g++ and glibc.
It is a documented limitation of glibc that only the C99 semantics are
available from strtod, not the ones from the old standard. See
CONFORMANCE in glibc 2.2. (This could in principle be fixed, if felt
worthwhile, by using different versions of strtod and __REDIRECT.)
--
Joseph S. Myers
jsm28@cam.ac.uk
More information about the Gcc-bugs
mailing list