Improve template & doc for PIMathFloatNullCompare #43

Merged
andrey merged 1 commits from math into master 2020-09-28 11:52:35 +03:00

View File

@@ -119,10 +119,10 @@ inline PIVector2D<double> abs(const PIVector2D<complexd> & v) {
/**
* @brief Inline funtion of compare with zero different types
* @brief floating point number specific comparison between value passed as parameter and zero
*
* @param v is input parameter of type T
* @return true if zero, false if not zero
* @param v floating point parameter for comparison
* @return true if v in locality of zero, otherwise false
*/
template<typename T, typename std::enable_if<std::is_floating_point<T>::value, int>::type = 0>
inline bool PIMathFloatNullCompare(const T v) {
@@ -131,13 +131,13 @@ inline bool PIMathFloatNullCompare(const T v) {
}
/**
* @brief Inline funtion of compare with zero colmplexf type
* @brief floating point number specific comparison between parameter value and zero.
*
* @param v is input parameter of type colmplexf
* @return true if zero, false if not zero
* @param v complex with floating point real and imag parts
* @return true if absolute of v in locality of zero, otherwise false
*/
template<typename T,typename std::enable_if<
std::is_floating_point<decltype(T::real)>::value ||
std::is_floating_point<decltype(T::real)>::value &&
std::is_floating_point<decltype(T::imag)>::value
, int>::type = 0>
inline bool PIMathFloatNullCompare(const T v) {