From 634e1170a3fa6b4e2e9dcbbcfa4cb467be06a848 Mon Sep 17 00:00:00 2001 From: Recep Aslantas Date: Sat, 30 Dec 2017 17:50:53 +0300 Subject: [PATCH] min and max util --- include/cglm/util.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/cglm/util.h b/include/cglm/util.h index d1b62a2..2d726a1 100644 --- a/include/cglm/util.h +++ b/include/cglm/util.h @@ -61,4 +61,20 @@ glm_pow2(float x) { return x * x; } +CGLM_INLINE +float +glm_min(float a, float b) { + if (a < b) + return a; + return b; +} + +CGLM_INLINE +float +glm_max(float a, float b) { + if (a < b) + return a; + return b; +} + #endif /* cglm_util_h */