diff --git a/vcg/math/base.h b/vcg/math/base.h index 65eac57d..9c2bf0e2 100644 --- a/vcg/math/base.h +++ b/vcg/math/base.h @@ -24,6 +24,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.13 2004/03/31 10:09:19 cignoni +int64 -> long long for GCC compatibility + Revision 1.12 2004/03/16 00:23:50 tarini - added VoidType - added "static_assert" @@ -101,37 +104,38 @@ namespace math { inline double Atan2(const double v0,const double v1) { return atan2(v0,v1); } - /// max and min values for each scala type + /// max and min values for each scalar type /// syntax: Max::Value template class Value { - public: static const SCALAR Min; static const SCALAR Max; + public: const SCALAR Min; const SCALAR Max; }; - const char Value::Min = -128; - const char Value::Max = +127; - const unsigned char Value::Min = 0; - const unsigned char Value::Max = 255; - const short Value::Min = (-32767 -1); - const short Value::Max = +32767; - const unsigned short Value::Min = 0; - const unsigned short Value::Max = 65535; - const int Value::Min = (-2147483647 - 1); - const int Value::Max = +2147483647; - const unsigned int Value::Min = 0; - const unsigned int Value::Max = 4294967295ul; - const long long Value::Min = (-9223372036854775807ll - 1); - const long long Value::Max = +9223372036854775807ll; - const long Value::Min = (-2147483647L -1L); - const long Value::Max = 2147483647L; - const unsigned long Value::Min = 0; - const unsigned long Value::Max = +4294967295ul; - const float Value::Min = -3.4E38F; - const float Value::Max = +3.4E38F; - const long double Value::Min = -1.2E308; //E4931? - const long double Value::Max = +1.2E308; - const double Value::Min = -1.7E308; - const double Value::Max = +1.7E308; + class Value { public: const char Min=-128; + const char Max=+127;}; + class Value { public: const unsigned char Min=0; + const unsigned char Max=255;}; + class Value { public: const short Min=(-32767 -1); + const short Max=+32767;}; + class Value { public: const unsigned short Min=0; + const unsigned short Max=65535;}; + class Value { public: const int Min=(-2147483647 - 1); + const int Max= +2147483647;}; + class Value { public: const unsigned int Min=0; + const unsigned int Max=4294967295;}; + class Value<__int64 > { public: const __int64 Min=(-9223372036854775807i64 - 1); + const __int64 Max= +9223372036854775807i64;}; + class Value { public: const long Min=(-2147483647L -1L); + const long Max= +2147483647L;}; + class Value { public: const unsigned long Min=0; + const unsigned long Max=4294967295;}; + class Value { public: const float Min=-3.4E38F; + const float Max=+3.4E38F;}; + class Value { public: const double Min=-1.7E308;; + const double Max=+1.7E308;}; + class Value { public: const long double Min=-1.7E308; //-1.2E4931 ? + const long double Max=+1.7E308;};//+1.2E4931 ? + template inline const T & Min(const T &a, const T &b){ if (a