1#ifndef CODEX_MATH_POWER_H
2#define CODEX_MATH_POWER_H
12 return e ==
T{} ?
T{1} :
b *
power(
b, e -
T{1});
19 t0 + t1; t0 - t1; t0 * t1; t0 / t1; t0 % t1;
20 t0 += t1; t0 -= t1; t0 *= t1; t0 /= t1; t0 %= t1;
26 && std::constructible_from<T, int>
27 && std::three_way_comparable<T>
32 [[maybe_unused]]
const T ib =
b, ie = e;
34 for(; e !=
T{}; e /=
T{2}) {
35 assert(ret * pow(
b, e) == pow(ib, ie));
36 if(e %
T{2} ==
T{1}) {
38 assert(pow(
b, e) ==
b * pow(
b, e -
T{1}));
42 assert(pow(
b, e - (e %
T{2})) == pow(
b *
b, e /
T{2}));
45 assert(ret * pow(
b, e) == pow(ib, ie));
46 assert(ret == pow(ib, ie));
static const struct board b
Definition chess0.c:57
constexpr T power(T b, T e)
Definition power.hpp:11
T power(T b, T e)
Definition power.hpp:29
codex::refl::field_tuple_t< E > T
Definition soa.cpp:9