diff options
Diffstat (limited to 'reference_model/src/arith_util.h')
-rw-r--r-- | reference_model/src/arith_util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/reference_model/src/arith_util.h b/reference_model/src/arith_util.h index fa6d136..d1cdeee 100644 --- a/reference_model/src/arith_util.h +++ b/reference_model/src/arith_util.h @@ -353,7 +353,7 @@ T applyClip(T value, U min_val, U max_val) value = applyMax<T>(value, min_val); // Handle the numbers of an unsigned type U that becomes unrepresentable when type casting to signed. - if (std::is_signed_v<T> && std::is_unsigned_v<U> && max_val > std::numeric_limits<T>::max()) + if (std::is_signed_v<T> && std::is_unsigned_v<U> && max_val > static_cast<U>(std::numeric_limits<T>::max())) { max_val = std::numeric_limits<T>::max(); } |