Skip to content

Commit

Permalink
Add suppression
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Oct 23, 2023
1 parent 4f281b5 commit 08286ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/calculate.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ R calculate(const std::string& s, const T& x, const T& y, bool* error = nullptr)
case '*':
return wrap(x * y);
case '/':
if (isZero(y) || (std::is_integral<T>::value && std::is_signed<T>::value && isEqual(y, T(-1)) && isEqual(x, std::numeric_limits<T>::min()))) {
if (isZero(y) || (std::is_integral<T>::value && std::is_signed<T>::value && isEqual(y, T(-1)) && isEqual(x, std::numeric_limits<T>::min()))) { // cppcheck.suppress knownConditionTrueFalse
if (error)
*error = true;
return R{};
}
return wrap(x / y);
case '%':
if (isZero(MathLib::bigint(y)) || (std::is_integral<T>::value && std::is_signed<T>::value && isEqual(y, T(-1)) && isEqual(x, std::numeric_limits<T>::min()))) {
if (isZero(MathLib::bigint(y)) || (std::is_integral<T>::value && std::is_signed<T>::value && isEqual(y, T(-1)) && isEqual(x, std::numeric_limits<T>::min()))) { // cppcheck.suppress knownConditionTrueFalse
if (error)
*error = true;
return R{};
Expand Down

0 comments on commit 08286ee

Please sign in to comment.