A
Adam H. Peterson
I have an application that uses C++ file streams for storing the state
of complex objects to be later read in, ideally reconstructing the state
of the object as when it was serialized. One issue I'm encountering,
though, is that when I serialize a double and then read it back in, I've
lost precision on the magnitude of 10^-6. Is there a way to tell a
stream to write a double (or any number format) to whatever precision is
required to recover the same number later?
Or should I be doing serialization another way? (I'm hoping I can do it
with streams. I want my data files to be portable, and it's valuable to
be able to look at them in an editor and see what's going on.)
Thanks in advance for any help.
Adam H. Peterson
of complex objects to be later read in, ideally reconstructing the state
of the object as when it was serialized. One issue I'm encountering,
though, is that when I serialize a double and then read it back in, I've
lost precision on the magnitude of 10^-6. Is there a way to tell a
stream to write a double (or any number format) to whatever precision is
required to recover the same number later?
Or should I be doing serialization another way? (I'm hoping I can do it
with streams. I want my data files to be portable, and it's valuable to
be able to look at them in an editor and see what's going on.)
Thanks in advance for any help.
Adam H. Peterson