ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

math_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 doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.