Mercurial > mm7
diff Math.h @ 1530:dec48a151390
Слияние
author | Ritor1 |
---|---|
date | Fri, 06 Sep 2013 16:42:32 +0600 |
parents | f0551cd4cbc9 |
children | 499761153844 |
line wrap: on
line diff
--- a/Math.h Fri Sep 06 16:42:23 2013 +0600 +++ b/Math.h Fri Sep 06 16:42:32 2013 +0600 @@ -1,11 +1,7 @@ #pragma once + #include <cassert> #include <limits> -#include <float.h> -#include <cmath> -#include <cstdlib> -#include <ciso646> - /* 186 */ #pragma pack(push, 1) @@ -28,26 +24,20 @@ }; #pragma pack(pop) - int fixpoint_sub0(int, int); int fixpoint_div(int, int); int fixpoint_mul(int, int); int fixpoint_from_float(float value); -#ifndef ROUNDING_EPSILON -#define ROUNDING_EPSILON 0.0000001 -#endif - - template <typename FloatType> -int bankersRounding( +inline int bankersRounding( const FloatType& value ) { assert("Method unsupported for this type" && false); return value; } -template<> static int bankersRounding<float>(const float& inValue) +template<> inline int bankersRounding<float>(const float& inValue) { union Cast { @@ -61,8 +51,7 @@ #pragma push_macro("max") #undef max - -template<> static int bankersRounding<double>(const double& inValue) +template<> inline int bankersRounding<double>(const double& inValue) { double maxValue = std::numeric_limits<int>::max(); assert(maxValue - 6755399441055744.0 >= inValue); @@ -75,8 +64,6 @@ c.d = inValue + 6755399441055744.0; return c.l; } - - #pragma pop_macro("max") -extern struct stru193_math *stru_5C6E00; \ No newline at end of file +extern struct stru193_math *stru_5C6E00;