diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-25 19:02:33 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-25 19:02:33 +0200 |
commit | 8133efd7f9def01b81ef2a52c05d8ec5b7f89632 (patch) | |
tree | a56f6889aea8de8759fab87abdee2eef778873ed /src/Defines.h | |
parent | Fixed bug in freeing NULL pointers (diff) | |
parent | inject TestGlobals.h correctly (diff) | |
download | cuberite-8133efd7f9def01b81ef2a52c05d8ec5b7f89632.tar cuberite-8133efd7f9def01b81ef2a52c05d8ec5b7f89632.tar.gz cuberite-8133efd7f9def01b81ef2a52c05d8ec5b7f89632.tar.bz2 cuberite-8133efd7f9def01b81ef2a52c05d8ec5b7f89632.tar.lz cuberite-8133efd7f9def01b81ef2a52c05d8ec5b7f89632.tar.xz cuberite-8133efd7f9def01b81ef2a52c05d8ec5b7f89632.tar.zst cuberite-8133efd7f9def01b81ef2a52c05d8ec5b7f89632.zip |
Diffstat (limited to 'src/Defines.h')
-rw-r--r-- | src/Defines.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Defines.h b/src/Defines.h index 9fa3b3a8e..563fc308c 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -3,6 +3,7 @@ #include "ChatColor.h" #include <limits> +#include <cmath> @@ -528,6 +529,15 @@ inline float GetSpecialSignf( float a_Val ) +template<class T> inline T Diff(T a_Val1, T a_Val2) +{ + return std::abs(a_Val1 - a_Val2); +} + + + + + // tolua_begin enum eMessageType |