From af05331358ed5fc992f777f6f1849a21077ef50b Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Fri, 13 Apr 2012 11:23:55 +1000 Subject: [PATCH] Move sign function to maths.hpp --- maths.hpp | 5 +++++ types.hpp | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/maths.hpp b/maths.hpp index c0fc230a..1ff22c54 100644 --- a/maths.hpp +++ b/maths.hpp @@ -127,4 +127,9 @@ max (const T &a , const T &b , const Args &...args ) { return max ( b > a ? b : a, args...); } +inline double sign (double x) { return x >= 0 ? 1.0 : -1.0; } +inline float sign (float x) { return x >= 0 ? 1.0 : -1.0; } +inline int sign (int x) { return x >= 0 ? 1 : -1 ; } + + #endif // __MATHS_HPP diff --git a/types.hpp b/types.hpp index 66ad9426..5dd23e56 100644 --- a/types.hpp +++ b/types.hpp @@ -161,9 +161,6 @@ struct fourcc { std::ostream& operator<< (std::ostream&, fourcc); -inline double sign (double x) { return x >= 0 ? 1.0 : -1.0; } -inline float sign (float x) { return x >= 0 ? 1.0 : -1.0; } -inline int sign (int x) { return x >= 0 ? 1 : -1 ; } #endif // __TYPES_HPP