X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftypes.h;h=cd0d361953663f2aeaf911662b430fa62e83ecaa;hp=dae86db310d6d80bc715e99c7aafd9ca482225e4;hb=bcbc9bfd1f5efeaa3f1e0b020e405f11984e72ec;hpb=7eda7335fd147c394de6aa13debc75f4b6639eb0;ds=sidebyside diff --git a/src/types.h b/src/types.h index dae86db3..cd0d3619 100644 --- a/src/types.h +++ b/src/types.h @@ -268,7 +268,7 @@ inline Score make_score(int mg, int eg) { return Score((mg << 16) + eg); } /// Extracting the signed lower and upper 16 bits it not so trivial because /// according to the standard a simple cast to short is implementation defined /// and so is a right shift of a signed integer. -inline Value mg_value(Score s) { return Value(((s + 32768) & ~0xffff) / 0x10000); } +inline Value mg_value(Score s) { return Value(((s + 0x8000) & ~0xffff) / 0x10000); } /// On Intel 64 bit we have a small speed regression with the standard conforming /// version, so use a faster code in this case that, although not 100% standard