mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 18:17:02 +08:00
Use std::abs over abs
closes https://github.com/official-stockfish/Stockfish/pull/4926 closes https://github.com/official-stockfish/Stockfish/pull/4909 No functional change Co-Authored-By: fffelix-huang <72808219+fffelix-huang@users.noreply.github.com>
This commit is contained in:
@@ -354,9 +354,9 @@ std::string UCI::value(Value v) {
|
||||
|
||||
std::stringstream ss;
|
||||
|
||||
if (abs(v) < VALUE_TB_WIN_IN_MAX_PLY)
|
||||
if (std::abs(v) < VALUE_TB_WIN_IN_MAX_PLY)
|
||||
ss << "cp " << UCI::to_cp(v);
|
||||
else if (abs(v) <= VALUE_TB)
|
||||
else if (std::abs(v) <= VALUE_TB)
|
||||
{
|
||||
const int ply = VALUE_TB - std::abs(v); // recompute ss->ply
|
||||
ss << "cp " << (v > 0 ? 20000 - ply : -20000 + ply);
|
||||
|
||||
Reference in New Issue
Block a user