We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 777b5f6 + 28cb217 commit 4a919adCopy full SHA for 4a919ad
1 file changed
core/math/math_funcs_binary.h
@@ -38,7 +38,7 @@ namespace Math {
38
39
// Returns `true` if a positive integer is a power of 2, `false` otherwise.
40
template <typename T>
41
-inline bool is_power_of_2(const T x) {
+constexpr bool is_power_of_2(const T x) {
42
return x && ((x & (x - 1)) == 0);
43
}
44
@@ -129,7 +129,7 @@ constexpr int32_t get_shift_from_power_of_2(uint32_t p_bits) {
129
130
131
132
-_FORCE_INLINE_ T nearest_power_of_2_templated(T p_number) {
+constexpr T nearest_power_of_2_templated(T p_number) {
133
--p_number;
134
135
// The number of operations on x is the base two logarithm
0 commit comments