mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-08 00:25:07 -05:00
util: fix UTI_Log2ToDouble() for maximum/minimum exponent
This commit is contained in:
4
util.c
4
util.c
@@ -649,11 +649,11 @@ UTI_Log2ToDouble(int l)
|
|||||||
if (l >= 0) {
|
if (l >= 0) {
|
||||||
if (l > 31)
|
if (l > 31)
|
||||||
l = 31;
|
l = 31;
|
||||||
return 1 << l;
|
return (uint32_t)1 << l;
|
||||||
} else {
|
} else {
|
||||||
if (l < -31)
|
if (l < -31)
|
||||||
l = -31;
|
l = -31;
|
||||||
return 1.0 / (1 << -l);
|
return 1.0 / ((uint32_t)1 << -l);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user