projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d44c067
)
chrony: fix conversion of very small floating-poing values
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
0733e13
..
6cf2914
100644
(file)
--- a/
src/chrony.c
+++ b/
src/chrony.c
@@
-584,9
+584,10
@@
static double ntohf(tFloat p_float) {
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);