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

>
> On Sat, 17 Aug 2019 06:07:14 +0800
> Sanjeev Gupta <gha...@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
_______________________________________________
devel mailing list
devel@ntpsec.org
http://lists.ntpsec.org/mailman/listinfo/devel

Reply via email to