We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f0e337e commit 561047fCopy full SHA for 561047f
weilycoder/number-theory/prime.hpp
@@ -100,6 +100,13 @@ constexpr bool is_prime(uint64_t n) {
100
return miller_rabin32(static_cast<uint32_t>(n));
101
return miller_rabin64(n);
102
}
103
+
104
+/**
105
+ * @brief Compile-time primality test for a given integer.
106
+ * @tparam x The integer to test for primality.
107
+ * @return true if x is prime, false otherwise.
108
+ */
109
+template <uint64_t x> constexpr bool is_prime() { return is_prime(x); }
110
} // namespace weilycoder
111
112
#endif
0 commit comments