atof returning a different floating value

This is not unexpected in the world of computers, it is down to rounding errors and the format that floats are stored in.

You can flog through the maths and see why this is but it does happen and, if it is an issue, you have to fix it by how you handle the numbers rather than trying to fix the compiler.