Parse -0 string as -0.0f

I'm learning C++ using Visual Studio 2015.

I have this method:

double ConvertDegreesToDecimal(std::string value)
{
    using namespace std;
    vector<float> values;
    string item;

    istringstream in(value);

    while (getline(in, item, ' '))
        values.push_back(atof(item.c_str()));

    DegreesCoordinate* coord = new DegreesCoordinate((short)values[0], (unsigned char)values[1], (double)values[2], NotSet);

    return DegreesConverter::convertDegressToDecimal(coord);
}

It works fine with all cases except with this one: -0 17 25. This number is a coordinate in degrees -0 degrees 17 minutes 25 seconds.

I have thought to check inside while (getline(in, item, ' ')) if item is -0 and then multiply atof(item.c_str()) by -1. But, what happens if item is -00 or -000.

Do you know a better approach to parse a negative zero?


Click here view more answers http://ift.tt/1Jfjfzl