lkml.org 
[lkml]   [2015]   [Jan]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] adjtimex: PPM scaling is by 2^-16
On Thu, Jan 01, 2015 at 08:41:20PM -0600, Jeff Epler wrote:
> Like Laurent Georget, I found by reading ntpd source
> the scale is 2^16 (i.e., 1 ~= 1.5e-5 ppm, 65536 = 1ppm)

Yep, you wont find this documented in prose anywhere, not even at
ntp.org.

> - long freq; /* Frequency offset, as scaled PPM
> + long freq; /* Frequency offset, in units of 2^-16 PPM
> (parts per million) */

This wording is correct.

IMHO, it is more understandable when you explain that this field is a
fixed point number, with a 16 bit binary fraction. For example, see
the comment in the function, ppb_to_scaled_ppm(), in
Documentation/ptp/testptp.c.


Thanks,
Richard


\
 
 \ /
  Last update: 2015-01-02 08:01    [W:0.114 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site