piCompare change position
This commit is contained in:
@@ -356,17 +356,6 @@ inline bool piCompareBinary(const void * f, const void * s, size_t size) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! @brief Function for compare two numeric values with epsilon
|
|
||||||
* \details Example:\n \snippet piincludes.cpp compare
|
|
||||||
* There are some macros:
|
|
||||||
* - \c piComparef for "float"
|
|
||||||
* - \c piCompared for "double"
|
|
||||||
*/
|
|
||||||
template<typename T>
|
|
||||||
inline bool piCompare(const T & a, const T & b, const T & epsilon = std::numeric_limits<T>::epsilon()) {
|
|
||||||
return piAbs(a - b) <= epsilon;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*! @brief Templated function return round of float falue
|
/*! @brief Templated function return round of float falue
|
||||||
* \details Round is the nearest integer value \n
|
* \details Round is the nearest integer value \n
|
||||||
* There are some macros:
|
* There are some macros:
|
||||||
@@ -483,6 +472,17 @@ inline void piLetobe(void * data, int size) {
|
|||||||
piSwap<uchar>(((uchar*)data)[size - i - 1], ((uchar*)data)[i]);
|
piSwap<uchar>(((uchar*)data)[size - i - 1], ((uchar*)data)[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! @brief Function for compare two numeric values with epsilon
|
||||||
|
* \details Example:\n \snippet piincludes.cpp compare
|
||||||
|
* There are some macros:
|
||||||
|
* - \c piComparef for "float"
|
||||||
|
* - \c piCompared for "double"
|
||||||
|
*/
|
||||||
|
template<typename T>
|
||||||
|
inline bool piCompare(const T & a, const T & b, const T & epsilon = std::numeric_limits<T>::epsilon()) {
|
||||||
|
return piAbs(a - b) <= epsilon;
|
||||||
|
}
|
||||||
|
|
||||||
/// @brief Templated function that inverse byte order of value "v"
|
/// @brief Templated function that inverse byte order of value "v"
|
||||||
template<typename T> inline void piLetobe(T * v) {piLetobe(v, sizeof(T));}
|
template<typename T> inline void piLetobe(T * v) {piLetobe(v, sizeof(T));}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user