2.4 continued (#8092)
Quite a bit of work on 2.4 Co-authored-by: 3djc <Th1sisfmyofmyo>
This commit is contained in:
co-authored by
3djc <Th1sisfmyofmyo>
parent
cd6aa7af00
commit
87cd9047b1
@@ -31,6 +31,18 @@ inline T sgn(T a)
|
||||
{
|
||||
return a > 0 ? 1 : (a < 0 ? -1 : 0);
|
||||
}
|
||||
|
||||
template<class t> inline t min(t a, t b) { return a<b?a:b; }
|
||||
template<class t> inline t max(t a, t b) { return a>b?a:b; }
|
||||
template<class t> inline t limit(t mi, t x, t ma) { return min(max(mi,x),ma); }
|
||||
|
||||
inline int divRoundClosest(const int n, const int d)
|
||||
{
|
||||
if (d == 0)
|
||||
return 0;
|
||||
else
|
||||
return ((n < 0) ^ (d < 0)) ? ((n - d/2)/d) : ((n + d/2)/d);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class T>
|
||||
|
||||
Reference in New Issue
Block a user