summaryrefslogtreecommitdiff
path: root/Userland/Services
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2021-07-05 20:05:19 +0200
committerGunnar Beutner <gunnar@beutner.name>2021-07-08 10:11:00 +0200
commit6f6b1b3ea121ab2c3144d9d6277ea84d6aea1f47 (patch)
treedf3a3669b6c80ebc71299c2e185b8ff2cbecbc14 /Userland/Services
parent44b6f402ae72d26b43efca6f68deab8d66c9e807 (diff)
downloadserenity-6f6b1b3ea121ab2c3144d9d6277ea84d6aea1f47.zip
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.
Diffstat (limited to 'Userland/Services')
-rw-r--r--Userland/Services/ChessEngine/MCTSTree.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Services/ChessEngine/MCTSTree.h b/Userland/Services/ChessEngine/MCTSTree.h
index 4241980822..6d522ccaf4 100644
--- a/Userland/Services/ChessEngine/MCTSTree.h
+++ b/Userland/Services/ChessEngine/MCTSTree.h
@@ -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 };