X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=70c91f8ae7a877d2ffdf6efbf6395120835c2ce9;hp=25ee79ead4df1ca94f1ddbe95d62a36b49496c84;hb=15616ad19965444ea66896a0511f2a4d48745110;hpb=1f40cd6d02374277abb5620d88d6fe58d7e9d6f7 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 25ee79ea..70c91f8a 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1083,7 +1083,7 @@ Value do_evaluate(const Position& pos, Value& margin) { int ev = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL; int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128; - return Value((result + GrainSize / 2) & ~(GrainSize - 1)); + return Value((result / GrainSize) * GrainSize); // Sign independent } // apply_weight() weights score v by score w trying to prevent overflow @@ -1140,8 +1140,6 @@ Value do_evaluate(const Position& pos, Value& margin) { std::string Tracing::do_trace(const Position& pos) { - Search::RootColor = pos.side_to_move(); - stream.str(""); stream << std::showpoint << std::showpos << std::fixed << std::setprecision(2); std::memset(scores, 0, 2 * (TOTAL + 1) * sizeof(Score));