I have noticed this issue with swprinf in VS 2008, and then i dig the reason behind it.
And i found that last bit is having lose with the data in last bit, which is lost in arithmetic of double operations. I believe atof is having some sort of arithmetic that is creating the loss.
So a solution such problem is what i was looking and i found it in codeproject in the below mentioned article:-
Five Tips for Floating Point Programming[
^]