From 444f05b59ad8a07ba9ed8a7ca9ba7eeecd5db3a7 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 26 Dec 2022 14:13:25 -0600 Subject: [PATCH] feat(math): add CMath::fint_n --- tempest/math/CMath.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tempest/math/CMath.hpp b/tempest/math/CMath.hpp index 97cd591..0054a7d 100644 --- a/tempest/math/CMath.hpp +++ b/tempest/math/CMath.hpp @@ -17,6 +17,10 @@ class CMath { return static_cast(n); } + static int32_t fint_n(float n) { + return n <= 0.0f ? static_cast(n - 0.5f) : static_cast(n + 0.5f); + } + static uint32_t fuint(float n) { return static_cast(n); }