00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef VCSN_CONFIG_MATH_HH
00018 # define VCSN_CONFIG_MATH_HH
00019
00041 # include <vaucanson/config/system.hh>
00042
00043 # include <cmath>
00044
00045 # ifndef USE_C_LIMITS
00046 # ifdef HAVE_LIMITS
00047 # define USE_CXX_LIMITS
00048 # endif
00049 # endif
00050
00051 # ifdef NEED_SQRTF
00052 static inline float sqrtf(float f)
00053 {
00054 return (float)sqrt((double)f);
00055 }
00056 # endif
00057
00058 # ifdef NEED_FLOORF
00059 static inline float floorf(float f)
00060 {
00061 return (float)floor((double)f);
00062 }
00063 # endif
00064
00065 # ifdef NEED_ROUND
00066 static inline double round(double f)
00067 {
00068 return (f < 0.) ? -floor(-f + 0.5) : floor(f + 0.5);
00069 }
00070 # endif
00071 # ifdef NEED_ROUNDF
00072 static inline float roundf(float f)
00073 {
00074 return (f < 0.f) ? -floorf(-f + 0.5f) : floorf(f + 0.5f);
00075 }
00076 # endif
00077
00078 #endif // ! VCSN_CONFIG_MATH_HH