Util.h
Go to the documentation of this file.
00001 #ifndef Util_H
00002 #define Util_H
00003 
00004 #include <cmath>
00005 
00006 static const double M_PI2 = 2 * M_PI;
00007 
00015 inline int fac(int n)
00016 {
00017   assert( n >= 0 );
00018   assert( n <= 12 );
00019 
00020   int static const fac[13] = {
00021     1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800,
00022     479001600};
00023 
00024   return fac[n];
00025 }
00026 
00033 inline int ftoi(float f)
00034 {
00035   return static_cast<int>( f + ( (f > 0.0f) ? (0.5f): (-0.5f) ) );
00036 }
00037 
00045 inline int min(int a, int b)
00046 {
00047   return (a<b)?a:b;
00048 }
00049 
00057 inline int max(int a, int b)
00058 {
00059   return (a>b)?a:b;
00060 }
00061 
00062 #endif


obj_rec_gui
Author(s): AGAS/agas@uni-koblenz.de
autogenerated on Mon Oct 6 2014 02:53:43