From 66aa423f27192b4f8c343e4997565570c552282d Mon Sep 17 00:00:00 2001 From: Aadhavan Srinivasan Date: Thu, 18 Jan 2024 19:28:29 -0500 Subject: [PATCH] Added math helper function --- math-helpers.hpp | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 math-helpers.hpp diff --git a/math-helpers.hpp b/math-helpers.hpp new file mode 100644 index 0000000..d3daaf6 --- /dev/null +++ b/math-helpers.hpp @@ -0,0 +1,6 @@ +int signum(int num) { + int retval = 0; + (num > 0) ? retval = 1 : retval = -1; + return retval; +} +