1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-29 12:50:28 +00:00

Ensures relative_exponents less than or equal to -32 don't overflow.

This commit is contained in:
Thomas Harte 2019-07-26 22:19:40 -04:00
parent 81b57ecf7c
commit 39d7e3c62c

View File

@ -264,7 +264,7 @@ struct Time {
// If the mantissa is negative and its absolute value fits within a 64-bit integer, // If the mantissa is negative and its absolute value fits within a 64-bit integer,
// just load up. // just load up.
if(relative_exponent <= 0 && relative_exponent > -64) { if(relative_exponent <= 0 && relative_exponent > -64) {
install_result(loaded_mantissa, uint64_t(1 << -relative_exponent)); install_result(loaded_mantissa, uint64_t(1) << -relative_exponent);
return; return;
} }