Closed dbrooke closed 10 years ago
Good catch and very clear explanation! Working on a solution... Thanks!
I just pushed a commit which uses a signed billionths value.
https://github.com/dbrooke/TinyGPSPlus/commit/1a958a07c2f5b65e870a1e9bf64713f633395342
I guess that that will slightly reduce precision.
Also I returned absolute value for raw billionths to avoid changing the public return type but that still leaves an ambiguity of sign for raw values where degrees is zero so maybe it should return signed.
Feel free to use or ignore as you see fit.
Thanks for the fix.
A position just E of the meridian, having iLngDegrees of 0, causes the test in TinyGPSLocation::lng() to subtract the billionths which results in the reported position being shown as negative (W).
The indication of W or E in TinyGPSPlus::endOfTermHandler() , which negates the degree value in the case of W, has no effect when the value is 0 since -0 is the same.
This issue will presumably also affect latitude values within 1 degree of the equator.