00001
00002
00003
00004
00005
00006
00008
00009
00010
00011 #ifndef _MATH_HPP
00012 #define _MATH_HPP
00013
00014 #ifndef __sgi
00015 #include <cmath>
00016 #include <cstdlib>
00017 #else
00018 #include <math.h>
00019 #include <stdlib.h>
00020 #endif
00021
00022 #ifdef PLATFORM_NO_ABS_FUNCTION
00023 float abs(float f)
00024 {
00025 return fabs(f);
00026 }
00027 #endif
00028
00029 inline float urand()
00030 {
00031 return (float)rand()/RAND_MAX;
00032 }
00033
00034 const float pi = 3.141592f;
00035
00036 #endif // #ifndef _MATH_HPP