aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/utility/NumberUtils.hpp
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-10-19 12:43:15 +0200
committer hop311 <hop3114@gmail.com>2024-10-19 12:44:53 +0200
commit5194a3d043db66b81470111a94f3b1cdf8d42176 (patch)
treeaca829171be7b1144cb3ca29510593fa8a84af24 /src/openvic-simulation/utility/NumberUtils.hpp
parent572ac597d8b43c4c97be4b68aa40de0e7ae6bfe0 (diff)
Add modifier effect variants based on the type of modifier being parsedresultant-modifier
Diffstat (limited to 'src/openvic-simulation/utility/NumberUtils.hpp')
-rw-r--r--src/openvic-simulation/utility/NumberUtils.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/openvic-simulation/utility/NumberUtils.hpp b/src/openvic-simulation/utility/NumberUtils.hpp
index d814019..8656f27 100644
--- a/src/openvic-simulation/utility/NumberUtils.hpp
+++ b/src/openvic-simulation/utility/NumberUtils.hpp
@@ -49,4 +49,8 @@ namespace OpenVic::NumberUtils {
return c;
}
+
+ constexpr bool is_power_of_two(uint64_t n) {
+ return n > 0 && (n & (n - 1)) == 0;
+ }
}