gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] PPS and doubles


From: Gary E. Miller
Subject: [gpsd-dev] PPS and doubles
Date: Sun, 1 Feb 2015 15:01:11 -0800

Yo All!

I have been trying to track down a PPS regression in loss of
precision.

commit e6d622fabf16b0ca90b18c8b30bfcf95bd2bf3af
Author: Eric S. Raymond <address@hidden>
Date:   Fri Aug 22 16:14:39 2014 -0400

    Re-integrate Miroslav's support for large PPS offsets.


-           l_offset = (long) offset;
-           if (0 > l_offset || 1000000 < l_offset) {
+           delay = (drift.clock.tv_sec + drift.clock.tv_nsec / 1e9) - 
last_fixtime_clock;
+           if (0.0 > delay || 1.0 < delay) {

Delay is 53 bits of precision.
tv_sec is 32, soon to be 33 bits of precision
tv_nsec = 20 bits of precision

So (tv_sec + tv_nsec / 1e9) is 63 bits of precision.
63 bits of precision does not fit in 53 bits of double!

This is why we do not use doubles in PPS land.

Please not ship until I fix this regression!

In your commit message:
            All regression tests pass.  PPS is live in both gpsd and gpsmon.

There are no regression tests for PPS!!!

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97701
        address@hidden  Tel:+1(541)382-8588



reply via email to

[Prev in Thread] Current Thread [Next in Thread]