[ntp:questions] sntp code: what pack_ntp is doung,

David J Taylor david-taylor at blueyonder.neither-this-bit.nor-this-bit.co.uk
Fri Apr 11 05:20:54 UTC 2008


> Pg wrote:
>
>>     for (i = 0; i < 8; ++i) {
>>         if ((k = (int)(d *= 256.0)) >= 256) k = 255;
>>         packet[NTP_TRANSMIT+i] = k;
>>         d -= k;
>>     }
>
>>
>> in this what is happening after deviding by NTP_SCALE and what is
>> happening inside for loop.

Shouldn't there be a comment near the code saying what it does?

David 





More information about the questions mailing list