[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] Print offset in ntpshmmon?
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-dev] Print offset in ntpshmmon? |
Date: |
Thu, 30 Apr 2015 11:08:31 -0700 |
Yo Miroslav!
On Thu, 30 Apr 2015 17:27:40 +0200
Miroslav Lichvar <address@hidden> wrote:
> On Tue, Apr 28, 2015 at 11:59:06AM -0700, Gary E. Miller wrote:
> > > > > > - offset = (float(record[3]) -
> > > > > > float(record[4]))
> > > > > > + offset = float(record[4])
> > > > >
> > > > > Both are pretty bad....
> > > >
> > > > You're the expert. Please fix it.
>
> > I have expected for some time that we would need to move to some
> > sort of arbitrary precision math, like decimal.Decimal or gmp.
>
> You can also keep the timestamps in nanoseconds, using long integers.
How long is a python long? 32 bit longs are not big enough. 64 bit
longs will not be big enough in 2038. Google '2038 NTP'.
ntpd already calculates to better than nanoSec, so any change should
be equal or better.
> But would be pystripchart able to display the data without losing
> precision?
Sure, the offset is the residue of the preccision.
> Offset is normally close to zero. I think printing the offset in
> ntpshmmon as a double and parsing it as a float in ntpshmviz would be
> fine.
Nope. The calcuation is being done in double and the nanoSec are lost.
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97701
address@hidden Tel:+1(541)382-8588
- Re: [gpsd-dev] Print offset in ntpshmmon?, (continued)
- Re: [gpsd-dev] Print offset in ntpshmmon?, Eric S. Raymond, 2015/04/21
- Re: [gpsd-dev] Print offset in ntpshmmon?, Gary E. Miller, 2015/04/21
- Re: [gpsd-dev] Print offset in ntpshmmon?, Miroslav Lichvar, 2015/04/22
- Re: [gpsd-dev] Print offset in ntpshmmon?, Gary E. Miller, 2015/04/22
- Re: [gpsd-dev] Print offset in ntpshmmon?, Eric S. Raymond, 2015/04/28
- Re: [gpsd-dev] Print offset in ntpshmmon?, Gary E. Miller, 2015/04/28
- Re: [gpsd-dev] Print offset in ntpshmmon?, Gary E. Miller, 2015/04/28
- Re: [gpsd-dev] Print offset in ntpshmmon?, Miroslav Lichvar, 2015/04/30
- Re: [gpsd-dev] Print offset in ntpshmmon?, Hal Murray, 2015/04/30
- Re: [gpsd-dev] Print offset in ntpshmmon?, Gary E. Miller, 2015/04/30
- Re: [gpsd-dev] Print offset in ntpshmmon?,
Gary E. Miller <=
Re: [gpsd-dev] Print offset in ntpshmmon?, Gary E. Miller, 2015/04/21