Sha256: 8ee17fcc9e4daf5cff0a167f77684b15d84aa55544d2185c77bb3533c3682d29
Contents?: true
Size: 498 Bytes
Versions: 135
Compression:
Stored size: 498 Bytes
Contents
#ifndef __MATH_AUX_H #define __MATH_AUX_H #include <limits> /* * This function is not only used to compare floating point values with a tolerance, * it also leads to ambiguity problems if the called functions do not have the * right prototype. */ template <class _Tp> bool are_equals(_Tp val, _Tp ref) { if (val < ref) { return (ref - val) <= std::numeric_limits<_Tp>::epsilon(); } else { return (val - ref) <= std::numeric_limits<_Tp>::epsilon(); } } #endif // __MATH_AUX_H
Version data entries
135 entries across 135 versions & 2 rubygems