Re: ifstream bug in VS2005 Beta2 & Platform SDK
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Wed, 1 Jun 2005 20:33:58 -0700
Sergei Nikolaev wrote:
> Thank you, Carl. The bug report has been submitted.
>
>> The C++ standard does not guarantee that it's possible to write out
>> a double as text and read it back in exactly no matter how many
>> digits of precision you specify. Unfortunately, the behavior you're
>> seeing is probably standard conformant, and hence probably won't be
>> changed.
>
> That is correct. But if someone wrote some number into some media,
> this would be reasonable to expect this data to be read exacly as it
> was written. May be an assert in my code is not guaranteed to be
> satisfied all the time, but IMHO at least all digits have to be read
> correctly.
That's exactly what's not guaranteed. It seems a resonable assumption, but
this very question came up a few months back and the conclusion was that
there's no guarantee that you can write out a double and read it back and be
guaranteed to get the same value bit for bit.
-cd
.
- References:
- ifstream bug in VS2005 Beta2 & Platform SDK
- From: Sergei Nikolaev
- Re: ifstream bug in VS2005 Beta2 & Platform SDK
- From: Carl Daniel [VC++ MVP]
- Re: ifstream bug in VS2005 Beta2 & Platform SDK
- From: Sergei Nikolaev
- ifstream bug in VS2005 Beta2 & Platform SDK
- Prev by Date: Re: ifstream bug in VS2005 Beta2 & Platform SDK
- Next by Date: allocator question (reposted here... sorry for the mistake)
- Previous by thread: Re: ifstream bug in VS2005 Beta2 & Platform SDK
- Next by thread: Re: ifstream bug in VS2005 Beta2 & Platform SDK
- Index(es):
Relevant Pages
|