kosma / minmea

a lightweight GPS NMEA 0183 parser library in pure C
Do What The F*ck You Want To Public License
791 stars 253 forks source link

Lost of precision due to the use of float as type for degrees #72

Open jmfermun opened 1 year ago

jmfermun commented 1 year ago

Function minmea_tocoord now converts positions from type minmea_float to type double.

Conversion from latitude and longitude to meters:

The use of the type minmea_float for storing the positions seems to be convenient:

Use of float for storing the positions is not convenient:

References:

matthieu-c-tagheuer commented 11 months ago

I also would like this modification.

KJ7LNW commented 9 months ago

+1, looks like a simple change. If there are MCUs out there that really can't or shouldn't be using doubles, then maybe provide a #ifdef MINMEA_USE_FLOAT for users that really need 32-bit floats?

johlim commented 9 months ago

I also would like this modification. there is experience of experiencing problems with float-type GPS coordinate errors.

lucid-at-dream commented 7 months ago

The tests are not building. You should change the use of fabsf in tests.c to fabs to follow the type change