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