Original Post
Hi! I'm using Visual C++ 6 (with the last Service Pack installed), and got some strange results working with floating point numbers. Just see the example bellow: Is that a rounding problem? How can I solve it without using double variables? Thanks!!
coordComplement.x = 2.9f;
blockSize = 29.0f;
coordComplement.x -= blockSize / 10.0f;
// coordComplement.x == 9.53674e-008 (WHAT?!)
coordComplement.x = 2.9f;
blockSize = 29.0f;
coordComplement.x -= 29.0f / 10.0f;
// coordComplement.x == 0.0f (OK!!)