From: Marco Costalba Date: Mon, 21 Feb 2011 11:45:51 +0000 (+0100) Subject: Correctly round evaluation to grain size X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=dd718d92a762fabeaed09d755474fcdd260392a2 Correctly round evaluation to grain size Signed-off-by: Marco Costalba --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 3c0be19d..53afc447 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -1105,7 +1105,7 @@ namespace { Value ev = Value((eg * int(sf)) / SCALE_FACTOR_NORMAL); int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128; - return Value(result & ~(GrainSize - 1)); + return Value((result + GrainSize / 2) & ~(GrainSize - 1)); }