8 static long roundTo(
long src,
long grid);
9 static double roundTo(
double src,
double grid);
12 static T max(T n1, T n2) {
13 static_assert(std::is_arithmetic<T>::value,
"The value for \"max\" must be arithemtic");
14 return (n1>n2) ? n1 : n2;
18 static T min(T n1, T n2) {
19 static_assert(std::is_arithmetic<T>::value,
"The value for \"min\" must be arithemtic");
20 return (n1<n2) ? n1 : n2;
24 static int sgn(T val) {
25 static_assert(std::is_arithmetic<T>::value,
"The value for \"val\" must be arithemtic");
26 return int(T(0) < val) - int(val < T(0));