New config feature - time1 can declare GPS wraparound compensation

Sanjeev Gupta ghane0 at gmail.com
Fri Aug 16 22:21:18 UTC 2019


On Sat, Aug 17, 2019 at 6:14 AM Gary E. Miller via devel <devel at ntpsec.org>
wrote:

>
> On Sat, 17 Aug 2019 06:07:14 +0800
> Sanjeev Gupta <ghane0 at gmail.com> wrote:
>
> > The widest integer I have is "long long int", which is 8 bytes.  I
> > need a bit more for "nuber of secs in 8192 weeks".
>
> Here is my math:
>
> seconds in 8192 weeks = 8192 weeks * 7 days in week * 24 hours in a day *
>                         60 minutes in an hour * 60 seconds in a minute
>
> >>> a = 8192 * 7 * 24 * 60 * 60
> >>> "%x" % a
> '127500000'
>
> Looks like 5 bytes to me.  Is my math wrong?
>

No, but (long long) int is signed, so you only get to use 4 bytes. :-(


> > Size of long long int: 8 bytes
>
> Looks good to me.
>

My new push (on Gitlab) uses (unsigned long long) , and tests OK on 32-bit
and 64-bit systems.

-- 
Sanjeev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20190817/4ee98f39/attachment.htm>


More information about the devel mailing list