Hello.
Im having a bit of a problem when it comes to reading floats form a text file for my serialization. The values seem to be modified a little by something, its really wierd.
For example, i do:
out<<rotation<<std::endl;
where rotation is a float value of 180.0f.
But later when i unserialize it:
instream>>rotation;
it will contain 179.000000061; or something like that, instead of 180. So you see the value is just a little off, which is so wierd.
Now i know you should'nt use << and >> and use binary mode instead, but there is too much code to change it now.
I have tried to write a little application doing nothing but reproducing the bug outside of my engine (which is huge). But i cant seem to reproduce it.
Anyone encounterd this? Im running out hair to pull out...
Thanks in advance.
[edited by - peter_b on March 28, 2004 1:16:14 PM]
[edited by - peter_b on March 28, 2004 1:17:01 PM]
[edited by - peter_b on March 28, 2004 1:17:33 PM]
[edited by - peter_b on March 28, 2004 1:18:15 PM]