Double precision options (software or hardware)


hello :)

i working on project need compute distance between 2 gps coordinates.
i have read arduinos treat "double" precision same "long" make gps coordinate math (which require more significant digits after decimal) wildly inaccurate.

so question is, arduino (chipset specifically) minimum (in terms of complexity, power usage, etc) can true "double" precision floating point operations...

or

is there clever workaround in software alleviate need double precision.
i.e. way temporarily ignore integer part of number (left of decimal place) in order free 2 additional digits "long" precision work on remaining number, adding in (this wild guess... sorry if terrible stupid). 

any kind of software workaround allow precise gps coordinate distance calculation on minimal arduino chipset fine me.

thanks in advance assistance!

--sean

atmega-based arduinos treat "double" same "float" (not "long").

several gps libraries (e.g. tinygps) available store latitude , longitude long integers, in degrees*10^6 or degrees*10^7, there no significant loss in precision.

however none know of course calculations in integer units. if navigational needs short distances (up few km), easy use equirectangular approximation both waypoint projection , bearing/distance calculations in integer units, no significant loss in precision or accuracy. can post couple of routines that, if like.

to knowledge, no 1 has implemented great circle calculations in integer units on arduino.


Arduino Forum > Using Arduino > Project Guidance > Double precision options (software or hardware)


arduino

Comments