mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 09:06:45 +08:00
Correctly round evaluation to grain size
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -1105,7 +1105,7 @@ namespace {
|
|||||||
Value ev = Value((eg * int(sf)) / SCALE_FACTOR_NORMAL);
|
Value ev = Value((eg * int(sf)) / SCALE_FACTOR_NORMAL);
|
||||||
|
|
||||||
int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128;
|
int result = (mg_value(v) * int(ph) + ev * int(128 - ph)) / 128;
|
||||||
return Value(result & ~(GrainSize - 1));
|
return Value((result + GrainSize / 2) & ~(GrainSize - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user