From 861bf27e96150822fff953cae72f991ca0ffbf36 Mon Sep 17 00:00:00 2001 From: Bananymous Date: Tue, 26 Dec 2023 00:54:06 +0200 Subject: [PATCH] BAN: Implement abs() --- BAN/include/BAN/Math.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BAN/include/BAN/Math.h b/BAN/include/BAN/Math.h index e87012871a..ca1252ce82 100644 --- a/BAN/include/BAN/Math.h +++ b/BAN/include/BAN/Math.h @@ -8,6 +8,12 @@ namespace BAN::Math { + template + inline constexpr T abs(T val) + { + return val < 0 ? -val : val; + } + template inline constexpr T min(T a, T b) {