aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/utility/NumberUtils.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-09-08 18:12:22 +0200
committer Hop311 <hop3114@gmail.com>2023-09-08 18:12:22 +0200
commit7772f8871348b7b52cb0a478bb76df68d8799a07 (patch)
treefd8c4626b2cee69a9fe9250365af6b18eea63c70 /src/openvic/utility/NumberUtils.hpp
parent7f9a9a8241ba81be9213e6606b8be4a48f1cbaab (diff)
More refactoring and duplicate code removal
Diffstat (limited to 'src/openvic/utility/NumberUtils.hpp')
-rw-r--r--src/openvic/utility/NumberUtils.hpp27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/openvic/utility/NumberUtils.hpp b/src/openvic/utility/NumberUtils.hpp
deleted file mode 100644
index 6211772..0000000
--- a/src/openvic/utility/NumberUtils.hpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <cstdint>
-
-namespace OpenVic::NumberUtils {
- constexpr int64_t round_to_int64(float num) {
- return (num > 0.0f) ? (num + 0.5f) : (num - 0.5f);
- }
-
- constexpr int64_t round_to_int64(double num) {
- return (num > 0.0) ? (num + 0.5) : (num - 0.5);
- }
-
- constexpr uint64_t pow(uint64_t base, size_t exponent) {
- uint64_t ret = 1;
- while (exponent-- > 0) {
- ret *= base;
- }
- return ret;
- }
-
- constexpr int64_t pow(int64_t base, size_t exponent) {
- int64_t ret = 1;
- while (exponent-- > 0) {
- ret *= base;
- }
- return ret;
- }
-}