No functional change.
Weights[KingDangerUs] = weight_option("Cowardice", "Cowardice", WeightsInternal[KingDangerUs]);
Weights[KingDangerThem] = weight_option("Aggressiveness", "Aggressiveness", WeightsInternal[KingDangerThem]);
- const int MaxSlope = 30;
- const int Peak = 1280;
+ const double MaxSlope = 30;
+ const double Peak = 1280;
for (int t = 0, i = 1; i < 100; ++i)
{
- t = std::min(Peak, std::min(int(0.4 * i * i), t + MaxSlope));
+ t = std::min(Peak, std::min(0.4 * i * i, t + MaxSlope));
KingDanger[1][i] = apply_weight(make_score(t, 0), Weights[KingDangerUs]);
KingDanger[0][i] = apply_weight(make_score(t, 0), Weights[KingDangerThem]);
stringstream ss;
if (abs(v) < VALUE_MATE_IN_MAX_PLY)
- ss << "cp " << v * 100 / int(PawnValueEg);
+ ss << "cp " << v * 100 / PawnValueEg;
else
ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;
// Convert from fullmove starting from 1 to ply starting from 0,
// handle also common incorrect FEN with fullmove = 0.
- gamePly = std::max(2 * (gamePly - 1), 0) + int(sideToMove == BLACK);
+ gamePly = std::max(2 * (gamePly - 1), 0) + (sideToMove == BLACK);
chess960 = isChess960;
thisThread = th;
ss << '-';
ss << (ep_square() == SQ_NONE ? " - " : " " + to_string(ep_square()) + " ")
- << st->rule50 << " " << 1 + (gamePly - int(sideToMove == BLACK)) / 2;
+ << st->rule50 << " " << 1 + (gamePly - (sideToMove == BLACK)) / 2;
return ss.str();
}
// Init futility move count array
for (d = 0; d < 32; ++d)
{
- FutilityMoveCounts[0][d] = int(2.4 + 0.222 * pow(d + 0.00, 1.8));
- FutilityMoveCounts[1][d] = int(3.0 + 0.300 * pow(d + 0.98, 1.8));
+ FutilityMoveCounts[0][d] = 2.4 + 0.222 * pow(d + 0.00, 1.8);
+ FutilityMoveCounts[1][d] = 3.0 + 0.300 * pow(d + 0.98, 1.8);
}
}
double ratio1 = (TMaxRatio * thisMoveImportance) / (TMaxRatio * thisMoveImportance + otherMovesImportance);
double ratio2 = (thisMoveImportance + TStealRatio * otherMovesImportance) / (thisMoveImportance + otherMovesImportance);
- return int(floor(myTime * std::min(ratio1, ratio2)));
+ return floor(myTime * std::min(ratio1, ratio2));
}
} // namespace
public:
void init(const Search::LimitsType& limits, int currentPly, Color us);
void pv_instability(double bestMoveChanges) { unstablePvFactor = 1 + bestMoveChanges; }
- int available_time() const { return int(optimumSearchTime * unstablePvFactor * 0.71); }
+ int available_time() const { return optimumSearchTime * unstablePvFactor * 0.71; }
int maximum_time() const { return maximumSearchTime; }
private: