--- a/src/basics.h Mon Mar 05 23:59:47 2018 +0200 +++ b/src/basics.h Tue Mar 06 23:29:40 2018 +0200 @@ -329,6 +329,15 @@ return x / qAbs(x); } +template<> +inline int sign(int x) +{ + if (x == 0) + return 0; + else + return x / qAbs(x); +} + /* * Returns the maximum of a single parameter (the parameter itself). */