mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-01-01 14:20:33 +01:00
Simplify rounding to avoid significant digit calculation edge-case
This commit is contained in:
parent
2a0488a3ef
commit
2f255872f9
|
|
@ -47,8 +47,7 @@ namespace SampleApp.WinDesktop
|
|||
else if(message is NmeaParser.Messages.Gst gst)
|
||||
{
|
||||
Gst = gst;
|
||||
int significantDigits = (int)Math.Ceiling(-Math.Log(Math.Min(Gst.SigmaLatitudeError%1, Gst.SigmaLongitudeError%1)));
|
||||
m_Accuracy = Math.Round(Math.Sqrt(Gst.SigmaLatitudeError * Gst.SigmaLatitudeError + Gst.SigmaLongitudeError * Gst.SigmaLongitudeError), significantDigits);
|
||||
m_Accuracy = Math.Round(Math.Sqrt(Gst.SigmaLatitudeError * Gst.SigmaLatitudeError + Gst.SigmaLongitudeError * Gst.SigmaLongitudeError), 3);
|
||||
}
|
||||
else if (message is NmeaParser.Messages.Rmc rmc)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue