43 #define declare_binary_minmax(Type) \ 44 static Type min(Type a, Type b); \ 45 static Type max(Type a, Type b) 47 #define implement_binary_minmax(Type) \ 48 inline Type Math::min(Type a, Type b) { return a < b ? a : b; } \ 49 inline Type Math::max(Type a, Type b) { return a > b ? a : b; } 51 #define declare_4_minmax(Type) \ 52 static Type min(Type a, Type b, Type c, Type d); \ 53 static Type max(Type a, Type b, Type c, Type d) 60 #define implement_4_minmax(Type) \ 61 inline Type Math::min(Type a, Type b, Type c, Type d) { \ 62 Type r1 = min(a, b), r2 = min(c, d); \ 66 inline Type Math::max(Type a, Type b, Type c, Type d) { \ 67 Type r1 = max(a, b), r2 = max(c, d); \ 84 static long abs(
long);
85 static double abs(
double);
87 static int round(
float);
88 static int round(
double);
90 static bool equal(
float x,
float y,
float e);
91 static bool equal(
double x,
double y,
double e);
109 return x - y < e && y - x <
e;
113 return x - y < e && y - x <
e;
declare_binary_minmax(int)
static bool equal(float x, float y, float e)
#define implement_4_minmax(Type)
#define implement_binary_minmax(Type)