gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] Print offset in ntpshmmon?


From: Beat Bolli
Subject: Re: [gpsd-dev] Print offset in ntpshmmon?
Date: Fri, 01 May 2015 21:14:10 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 01.05.15 21:06, Gary E. Miller wrote:
> Yo Beat!
> 
> On Fri, 01 May 2015 21:00:08 +0200
> Beat Bolli <address@hidden> wrote:
> 
>> On 01.05.15 20:53, Gary E. Miller wrote:
>>> Yo Beat!
>>>
>>> On Fri, 01 May 2015 20:46:31 +0200
>>> Beat Bolli <address@hidden> wrote:
>>>
>>>> On 30.04.15 20:08, Gary E. Miller wrote:
>>>>
>>>>> 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'.
>>>>
>>>> Python longs have unlimited (well, technically limited by available
>>>> RAM) size. No problem to calculate the 1000!.
>>>
>>> Got a canonical reference for that?
>>
>> https://docs.python.org/2/reference/lexical_analysis.html#integer-and-long-integer-literals
> 
> That is for literals.  What about in computations?

The same. As soon as an integer calculation exceeds the size of a C int,
Python switches to its own arbitrary-precision long implementation:

$ python
>>> a = 0xF0000000
>>> a
4026531840
>>> 2 * a
8053063680
>>> a * a
16212958658533785600L
>>> ^D
$

>>> How long is a float?
>>
>> From the very following section on the page above:
>>
>>> The allowed range of floating point literals is implementation-
>>> dependent.
>>
>> :-( I assume this means that CPython floats use the C compiler's
>> double.
>>
>> How about using https://en.wikipedia.org/wiki/Long_double ?
> 
> In theory, yes, on am ARM with no FPU that would be criminally slow.
> 
> So depends on the application I guess.

Hrrmmm, though so.

Beat
-- 
https://drbeat.li
pgp: 0x506A903A; 49D5 794A EA77 F907 764F  D89E 304B 93CF 506A 903A
gsm: 4.7.7.6.0.7.7.9.7.1.4.e164.arpa
icbm: 47.0452 N, 7.2715 E

"It takes love over gold, and mind over matter" -- Dire Straits

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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