Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenmath_aux.h
Go to the documentation of this file.
00001 #ifndef __MATH_AUX_H 00002 #define __MATH_AUX_H 00003 00004 #include <limits> 00005 00006 #undef __STD 00007 #if !defined (STLPORT) || defined (_STLP_USE_NAMESPACES) 00008 # define __STD std:: 00009 #else 00010 # define __STD 00011 #endif 00012 00013 /* 00014 * This function is not only used to compare floating point values with a tolerance, 00015 * it also leads to ambiguity problems if the called functions do not have the 00016 * right prototype. 00017 */ 00018 template <class _Tp> 00019 bool are_equals(_Tp val, _Tp ref) { 00020 if (val < ref) { 00021 return (ref - val) <= __STD numeric_limits<_Tp>::epsilon(); 00022 } 00023 else { 00024 return (val - ref) <= __STD numeric_limits<_Tp>::epsilon(); 00025 } 00026 } 00027 00028 #undef __STD 00029 00030 #endif // __MATH_AUX_H Generated on Sun May 27 2012 04:35:29 for ReactOS by
1.7.6.1
|