summaryrefslogtreecommitdiff
path: root/library/globalFunctions.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:48:05 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:48:05 +0200
commite7ceb20f1d6497f28054dc111260be8ba8d8b5aa (patch)
tree0d21c616743626435afd9e14922a27c45ceba772 /library/globalFunctions.h
parent1.4 (diff)
downloadFreeFileSync-e7ceb20f1d6497f28054dc111260be8ba8d8b5aa.tar.gz
FreeFileSync-e7ceb20f1d6497f28054dc111260be8ba8d8b5aa.tar.bz2
FreeFileSync-e7ceb20f1d6497f28054dc111260be8ba8d8b5aa.zip
1.5
Diffstat (limited to 'library/globalFunctions.h')
-rw-r--r--library/globalFunctions.h9
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
bgstack15