mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Core: still resolving sad abs issues
git-svn-id: svn://ultimatepp.org/upp/trunk@10481 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
20b71cd9f0
commit
2c7df30513
1 changed files with 3 additions and 11 deletions
|
|
@ -4,17 +4,9 @@ inline int sgn(T a) { return a > 0 ? 1 : a < 0 ? -1 : 0; }
|
|||
template <class T>
|
||||
inline T tabs(T a) { return (a >= 0 ? a : -a); }
|
||||
|
||||
#ifndef COMPILER_MSC
|
||||
template <class T>
|
||||
inline T abs(T a) { return (a >= 0 ? a : -a); }
|
||||
|
||||
/*
|
||||
inline double abs(double a) { return (a >= 0 ? a : -a); }
|
||||
inline float abs(float a) { return (a >= 0 ? a : -a); }
|
||||
inline int64 abs(int64 a) { return (a >= 0 ? a : -a); }
|
||||
inline int16 abs(int16 a) { return (a >= 0 ? a : -a); }
|
||||
inline int8 abs(int8 a) { return (a >= 0 ? a : -a); }*/
|
||||
#endif
|
||||
// there is a general mess about abs, this is not ideal but best we can do now... as long as we
|
||||
// do not want abs(1.1) == 1 surprise in GCC
|
||||
template <class T> inline T abs(T a) { return (a >= 0 ? a : -a); }
|
||||
|
||||
template <class T>
|
||||
inline int cmp(const T& a, const T& b) { return a > b ? 1 : a < b ? -1 : 0; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue