From 2b46b38da2013853ce928cd079a97c7957c4616c Mon Sep 17 00:00:00 2001 From: lisyarus Date: Thu, 15 Jul 2021 18:56:53 +0300 Subject: [PATCH] Add geom::frac --- libs/geom/include/psemek/geom/math.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/geom/include/psemek/geom/math.hpp b/libs/geom/include/psemek/geom/math.hpp index ea820d1c..6894d080 100644 --- a/libs/geom/include/psemek/geom/math.hpp +++ b/libs/geom/include/psemek/geom/math.hpp @@ -25,6 +25,12 @@ namespace psemek::geom return x * x; } + template + auto frac(T const & x) + { + return x - std::floor(x); + } + template T deg(T x) {