Commit 716b7a61 authored by Federico Vaga's avatar Federico Vaga

lib: fix to_ns convertion

Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent a869ec6b
......@@ -21,9 +21,9 @@ uint64_t fmctdc_ts_approx_ns(struct fmctdc_time *a)
{
uint64_t ns = 0;
ns += a->seconds * 1000000000;
ns += a->coarse * 8;
ns += a->frac * 81.03 / 1000; /* FIXME check this because in other func is different */
ns += a->seconds * 1000000000ULL;
ns += ((uint64_t)a->coarse) * 8ULL;
ns += ((uint64_t)a->frac) * 8000ULL / 4096ULL / 1000ULL;
return ns;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment