   Some wired problem with floats
  Hello!I have a problem with floats. My engine writes down the engine version at the beginning of the map, just like 0.09, but when it reads it again, the 0.09 transformed to 0.89999999 or something like that. What can I do against that?   
  0.09 isn't exactly representable by binary floating point numbers. You might want to read  this.   ;  Version numbers are not floating-point numbers.The probem you're having is that the decimal value 0.09 does not have a finite binary representation. No matter whether your data file format is text or binary (though I assume it's binary) you should use integers for version numbers, for the same reason you'd use an integer for index numbers.There are many ways to store version numbers. It's largely up to you, but you may find, for example, that two integers, for the major and minor version numbers, will be sufficient. In a binary format, you can store these as one byte each, or as the upper and lower four bits of one byte.;  Okay.. I will use a int and 009 then. Thanks for your advice!   ;  009 is not a valid literal, just try it ;)int version = 009;;  Yes, I know this. Just to lazy to edit my posting ;) So, 0.09 will become 9 and 0.10 will become 10 and 1.23 will become 123. Thats how I'm going to do it.   ;  Or, you could use three bytes. It's not like you're likely to have your version number (Major, minor or otherwise) be higher than 255.   ;  Use strings. Or if you want to keep the ability to sort version numbers correctly, store it as a set of 2 or 3 integers. But you may want to pad the integers with zeroes, as something like 1.02 will come out as just 1.2. You can use the setw and setfill functions which are included with the <iomanip> header.int v0 = 1;int v1 = 2;int v2 = 45;cout << "Version: " << v0 << "." << setw(2) << setfill('0') << v1 << "." << setw(4) << v2 << endl;