summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d44c067)
raw | patch | inline | side by side (parent: d44c067)
author | Miroslav Lichvar <mlichvar@redhat.com> | |
Thu, 23 Feb 2017 11:56:30 +0000 (12:56 +0100) | ||
committer | Miroslav Lichvar <mlichvar@redhat.com> | |
Thu, 23 Feb 2017 14:39:37 +0000 (15:39 +0100) |
This is copied from the chrony code.
src/chrony.c | patch | blob | history |
diff --git a/src/chrony.c b/src/chrony.c
index 0733e130ba649d581c4f0b07b0e741529453788e..6cf2914485ab0e15f4766fb27275b7768692473f 100644 (file)
--- a/src/chrony.c
+++ b/src/chrony.c
uint32_t uval;
uval = ntohl(p_float.value);
- exp = (uval >> FLOAT_COEF_BITS) - FLOAT_COEF_BITS;
+ exp = (uval >> FLOAT_COEF_BITS);
if (exp >= 1 << (FLOAT_EXP_BITS - 1))
exp -= 1 << FLOAT_EXP_BITS;
+ exp -= FLOAT_COEF_BITS;
/* coef = (x << FLOAT_EXP_BITS) >> FLOAT_EXP_BITS; */
coef = uval % (1U << FLOAT_COEF_BITS);