7 #ifndef BALL_MATHS_COMMON_H
8 #define BALL_MATHS_COMMON_H
10 #ifndef BALL_CONFIG_CONFIG_H
11 # include <BALL/CONFIG/config.h>
16 #ifdef BALL_HAS_IEEEFP_H
20 #ifdef BALL_HAS_FLOAT_H
24 #ifndef BALL_COMMON_CONSTANTS_H
28 #ifndef BALL_COMMON_GLOBAL_H
32 #ifndef BALL_COMMON_MACROS_H
79 T
max(
const T& a,
const T& b)
92 T
max(
const T& a,
const T& b,
const T &ct)
104 template <
typename T>
106 T
min(
const T& a,
const T& b)
117 template <
typename T>
119 T
min(
const T& a,
const T& b,
const T &ct)
129 template <
typename T>
133 return (T)(t > 0 ? long(t + 0.5) : long(t - 0.5));
140 template <
typename T>
151 template <
typename T>
155 #ifdef BALL_COMPILER_MSVC
166 template <
typename T>
170 #ifdef BALL_COMPILER_MSVC
171 return (_isnan(t) != 0);
172 #elif defined(BALL_OS_DARWIN)
173 return ( __inline_isnand(t) != 0);
175 return (isnan(t) != 0);
183 template <
typename T>
194 template <
typename T>
205 template <
typename T>
217 template <
typename T1,
typename T2>
229 template <
typename T1,
typename T2>
241 template <
typename T1,
typename T2>
254 template <
typename T1,
typename T2>
266 template <
typename T1,
typename T2>
278 template <
typename T1,
typename T2>
289 template <
typename T>
300 template <
typename T>
312 template <
typename T1,
typename T2>
325 template <
typename T>
327 bool isNear(
const T& a,
const T& b,
const T& max_diff)
329 return (
abs((
double)a - (
double)b) <
abs((
double)max_diff));
336 if (x < 0.0)
return (
double)(int)(x - 0.5);
337 else return (
double)(int)(x + 0.5);
345 #endif // BALL_MATHS_COMMON_H
bool isLessOrEqual(const T1 &a, const T2 &b)
bool isEqual(const T1 &a, const T2 &b)
#define BALL_MAX3(x, y, z)
bool isNear(const T &a, const T &b, const T &max_diff)
bool isNotZero(const T &t)
bool isGreaterOrEqual(const T1 &a, const T2 &b)
bool isFinite(const T &t)
BALL_EXTERN_VARIABLE double EPSILON
double rint(double x)
round to integral value in floating-point format
T max(const T &a, const T &b)
bool isGreater(const T1 &a, const T2 &b)
bool isInfinite(const T &t)
bool isNotEqual(const T1 &a, const T2 &b)
bool isLess(const T1 &a, const T2 &b)
#define BALL_MIN3(x, y, z)
Index compare(const T1 &a, const T2 &b)
T min(const T &a, const T &b)