use strtod because that makes more sense
C++ solution
Add C++11 solution