mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Replace hardcoded 128 by constant
No functional change.
This commit is contained in:
parent
aecdbfc4a0
commit
a0cf424cfc
1 changed files with 3 additions and 3 deletions
|
@ -1089,9 +1089,9 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
|||
assert(eg_value(v) > -VALUE_INFINITE && eg_value(v) < VALUE_INFINITE);
|
||||
assert(ph >= PHASE_ENDGAME && ph <= PHASE_MIDGAME);
|
||||
|
||||
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) * GrainSize); // Sign independent
|
||||
int e = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL;
|
||||
int r = (mg_value(v) * int(ph) + e * int(PHASE_MIDGAME - ph)) / PHASE_MIDGAME;
|
||||
return Value((r / GrainSize) * GrainSize); // Sign independent
|
||||
}
|
||||
|
||||
// apply_weight() weights score v by score w trying to prevent overflow
|
||||
|
|
Loading…
Add table
Reference in a new issue