BenBot
1.7.5
A chess engine
Loading...
Searching...
No Matches
Math.hpp
Go to the documentation of this file.
1
/*
2
* ======================================================================================
3
*
4
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓███████▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░▒▓████████▓▒░
5
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
6
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
7
* ░▒▓███████▓▒░░▒▓██████▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
8
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
9
* ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░░▒▓█▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓█▓▒░
10
* ░▒▓███████▓▒░░▒▓████████▓▒░▒▓█▓▒░░▒▓█▓▒░ ░▒▓███████▓▒░ ░▒▓██████▓▒░ ░▒▓█▓▒░
11
*
12
* ======================================================================================
13
*/
14
20
25
26
#pragma once
27
28
#include <concepts>
29
#include <cstdint>
// IWYU pragma: keep - for std::uint64_t
30
#include <utility>
31
35
namespace
util::math
{
36
40
template
<std::
int
egral T>
41
[[nodiscard, gnu::const]]
constexpr
auto
is_even
(
42
const
T value)
noexcept
43
->
bool
44
{
45
return
std::cmp_equal(
46
value %
static_cast<
T
>
(2),
47
0);
48
}
49
50
using
std::uint64_t;
51
56
[[nodiscard, gnu::const]]
auto
mul_hi64
(
57
uint64_t first, uint64_t second)
noexcept
58
-> uint64_t;
59
60
}
// namespace util::math
util::math::is_even
constexpr auto is_even(const T value) noexcept -> bool
Definition
Math.hpp:41
util::math::mul_hi64
auto mul_hi64(uint64_t first, uint64_t second) noexcept -> uint64_t
util::math
Definition
Math.hpp:35
libutil
include
libutil
Math.hpp
Generated on
for BenBot by
1.16.1