From 4a5a8d59feca4b6fc065b42954d80844fe27fe69 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Mon, 21 Mar 2022 15:58:08 +0100 Subject: [PATCH] matrix helper: add documentation for sign function --- src/lib/matrix/matrix/helper_functions.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/matrix/matrix/helper_functions.hpp b/src/lib/matrix/matrix/helper_functions.hpp index b1e0890407..7426fdcf57 100644 --- a/src/lib/matrix/matrix/helper_functions.hpp +++ b/src/lib/matrix/matrix/helper_functions.hpp @@ -152,6 +152,12 @@ Type unwrap_pi(const Type last_angle, const Type new_angle) return unwrap(last_angle, new_angle, Type(-M_PI), Type(M_PI)); } +/** + * Type-safe sign/signum function + * + * @param[in] val Number to take the sign from + * @return -1 if val < 0, 0 if val == 0, 1 if val > 0 + */ template int sign(T val) {