From: Joost VandeVondele Date: Mon, 21 Jun 2021 06:23:50 +0000 (+0200) Subject: Fix build error on OSX X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=2e2865d34b6767e60ea55277bc6b1d642795ecc3 Fix build error on OSX directly use integer version for cp calculation. fixes https://github.com/official-stockfish/Stockfish/issues/3573 closes https://github.com/official-stockfish/Stockfish/pull/3574 No functional change --- diff --git a/src/nnue/evaluate_nnue.cpp b/src/nnue/evaluate_nnue.cpp index a918b925..8828ae51 100644 --- a/src/nnue/evaluate_nnue.cpp +++ b/src/nnue/evaluate_nnue.cpp @@ -232,7 +232,7 @@ namespace Stockfish::Eval::NNUE { buffer[0] = (v < 0 ? '-' : v > 0 ? '+' : ' '); - int cp = (int)(std::abs(100.0 * double(v) / PawnValueEg)); + int cp = std::abs(100 * v / PawnValueEg); if (cp >= 10000) { @@ -261,7 +261,7 @@ namespace Stockfish::Eval::NNUE { static void format_cp_aligned_dot(Value v, char* buffer) { buffer[0] = (v < 0 ? '-' : v > 0 ? '+' : ' '); - int cp = (int)(std::abs(100.0 * double(v) / PawnValueEg)); + int cp = std::abs(100 * v / PawnValueEg); if (cp >= 10000) {