util: fix UTI_Log2ToDouble() for maximum/minimum exponent
This commit is contained in:
parent
85a9a53e69
commit
7f58852ec0
1 changed files with 2 additions and 2 deletions
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue