1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:07:45 +00:00

ChessEngine: Don't call non-constexpr sqrt in a constexpr intiializer

GCC likely has a builtin intrinsic that evaluates the operation at
compile-time, even if the `LibM` is not declared as constexpr. Clang,
however, does not like it, and it failed to compile this code.
This commit is contained in:
Daniel Bertalan 2021-07-05 20:05:19 +02:00 committed by Gunnar Beutner
parent 44b6f402ae
commit 6f6b1b3ea1

View file

@ -36,7 +36,7 @@ public:
private:
// While static parameters are less configurable, they don't take up any
// memory in the tree, which I believe to be a worthy tradeoff.
static constexpr double s_exploration_parameter { sqrt(2) };
static constexpr double s_exploration_parameter { M_SQRT2 };
// FIXME: Optimize simulations enough for use.
static constexpr EvalMethod s_eval_method { EvalMethod::Heuristic };