13 #ifndef ML_TYPE_DEF_TRAITS_H
14 #define ML_TYPE_DEF_TRAITS_H
21 #include <ThirdPartyWarningsDisable.h>
25 # define __ML_1ST_WINDOWS_2ND_UNIX_FUNCTION(__ml_win_func,__ml_unix_func) __ml_win_func
28 # define __ML_1ST_WINDOWS_2ND_UNIX_FUNCTION(__ml_win_func,__ml_unix_func) __ml_unix_func
32 #include <boost/static_assert.hpp>
34 #include <ThirdPartyWarningsRestore.h>
103 template <
typename DT>
104 inline DT MLAbs(
const DT val){
return (val < 0) ? -val : val; }
118 namespace ML_NAMESPACE {
119 template <
typename DT>
123 BOOST_STATIC_ASSERT(std::numeric_limits<DT>::is_integer);
124 return (val < 0) ? -val : val;
143 template <
typename T>
165 template <
typename T1,
typename T2>
185 template <
typename T1,
typename T2>
205 template <
typename T1,
typename T2>
225 template <
typename T1,
typename T2>
245 template <
typename T1>
MLint8 MLTypeRangeMax(MLint8)
Returns the maximum range of the data type of any passed standard data type value.
bool MLFloatValuesEqual(const T a, const T b, const T m)
Returns true if floating point numbers a and b differ less or equal than their technically availably ...
MLint8 MLTypeRangeMin(MLint8)
Returns the minimum range of the data type of any passed standard data type value.
bool MLValuesAreEqual(MLint8 a, MLint8 b, MLint8)
Returns true if values are equal (numerically safely compared); otherwise, it returns false.
bool MLValuesDiffer(MLint8 a, MLint8 b, MLint8)
Returns true if values differ (numerically safely compared); otherwise, it returns false.
MLfloat MLfabs(MLfloat v)
fabs functions to implement type and platform independent MLabs function.
bool MLValueIs0WOM(MLint8 a)
Returns true if value is 0; otherwise, it returns false.
DT MLAbs(const DT val)
Defines a templated MLAbs version to circumvent fabs ambiguities on different platforms.
int MLisnan(MLdouble v)
Returns a non-zero value if and only if its argument is NaN.
bool MLValuesDifferWOM(MLint8 a, MLint8 b)
Returns true if values differ; otherwise, it returns false.
int MLisfinite(MLdouble v)
Returns a non-zero value if and only if its argument has a finite value.
bool MLValuesAreEqualWOM(MLint8 a, MLint8 b)
Returns true if values a and b are equal; otherwise, it returns false.
MLint8 MLTypeMinDifference(MLint8)
Returns the minimum range between two values that should be considered significant.
#define __ML_1ST_WINDOWS_2ND_UNIX_FUNCTION(__ml_win_func, __ml_unix_func)
Some traits and template support for types and constants from mlTypeDefs project.
UINT64 MLuint64
Introduce platform-independent 64-bit unsigned integer type.
#define ML_LDOUBLE_EPSILON
INT64 MLint64
Include 64-bit integer support for Windows or Unix.
#define ML_DOUBLE_EPSILON