diff options
Diffstat (limited to 'library/globalFunctions.h')
-rw-r--r-- | library/globalFunctions.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/library/globalFunctions.h b/library/globalFunctions.h index 5fe576e1..d9c0d69f 100644 --- a/library/globalFunctions.h +++ b/library/globalFunctions.h @@ -12,10 +12,11 @@ namespace globalFunctions { int round(double d); //little rounding function - int abs(const int d); //absolute value - unsigned int abs(const unsigned int d); //absolute value - float abs(const float d); //absolute value - double abs(const double d); //absolute value + template <class T> + T abs(const T& d) //absolute value + { + return(d<0?-d:d); + } string numberToString(const unsigned int number); //Convert number to string string numberToString(const int number); //Convert number to string |