Longitude calculation of GPS library

12 Mar 2010 . Edited: 18 Mar 2010

I found issue in GPS library (http://mbed.org/projects/cookbook/wiki/GPS).

In the original code, the following calculation of longitude returns wrong value;

degrees = trunc(longitude / 100.0f * 0.01f);  //<--
minutes = longitude - (degrees * 100.0f);
longitude = degrees + minutes / 60.0f;

 

I think it should be;

degrees = trunc(longitude / 100.0f);
minutes = longitude - (degrees * 100.0f);
longitude = degrees + minutes / 60.0f;