diff --git a/tools/imatrix/imatrix.cpp b/tools/imatrix/imatrix.cpp index 610f840e30..7d7aaf609c 100644 --- a/tools/imatrix/imatrix.cpp +++ b/tools/imatrix/imatrix.cpp @@ -223,7 +223,7 @@ static bool compute_vector_statistics(std::vector & tstats, c if (div > 0.0) { for (float w : weights) { const float p = w / div; - if (p > 0.0) entropy -= p * std::log2(p); + if (p > 0.0) { entropy -= p * std::log2(p); } } } }