[aprssig] APRS LAT/LONG standards
Henk de Groot
henk.de.groot at hetnet.nl
Fri Jun 3 15:55:53 EDT 2005
Tapio Sokura schreef:
> Yeah, looks like I forgot to say the most important thing along with the
> example. Knowing that there are 60 minutes in a degree and 60 seconds in
> a minute should be sufficient for figuring out how it goes in practice.
Well, simple math can be presented a little bit too simple too!
For example try the math on 5.99999:
That will convert to 5 minutes and 59.9994 seconds, when rounding it to 2
decimals you get... 5 minutes and 60.00 seconds... Obviously that should
have been 6 minutes and 0 seconds...
In other words, beware of rounding errors! I know at one time 00600.00E
was shown as 00560.00E in AprsDOS (I think Bob fixed it at that time).
So beware of these boundary anomalities. This can bite you easily when you
are using decimal minutes in a floating point representation in your
application. Floating point numbers are known for their rounding errors.
Since 1/60 cannot be represented in floating point binary without rounding
errors, 1.00 minute may easy end up as 0.9999999999999 after converting to
a floating point decimal degree and back to minutes.
Kind regards,
Henk.
More information about the aprssig
mailing list