aboutsummaryrefslogtreecommitdiff
path: root/source/Utils.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Utils.hpp')
-rw-r--r--source/Utils.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/Utils.hpp b/source/Utils.hpp
index 3d04e62..03fdfed 100644
--- a/source/Utils.hpp
+++ b/source/Utils.hpp
@@ -14,4 +14,8 @@ enum IoMode {
FILE* OpenCstdioFile(const std::filesystem::path& path, IoMode mode, bool binary = false);
FILE* OpenCstdioFile(const char* path, IoMode mode, bool binary = false);
+constexpr float Abs(float v) noexcept {
+ return v < 0.0f ? -v : v;
+}
+
} // namespace Utils