src/basics.h

changeset 1273
900f1dfae46b
parent 1181
ca6d0ef9aadb
child 1291
9c570a30c98a
--- 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).
  */

mercurial