00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef __PIMATH__
00035 #define __PIMATH__
00036
00037 #include <pidefs.h>
00038
00039 #include <math.h>
00040
00041 #ifndef M_E
00042 # define M_E 2.7182818284590452354
00043 #endif
00044 #ifndef M_LOG2E
00045 # define M_LOG2E 1.4426950408889634074
00046 #endif
00047 #ifndef M_LOG10E
00048 # define M_LOG10E 0.43429448190325182765
00049 #endif
00050 #ifndef M_LN2
00051 # define M_LN2 0.69314718055994530942
00052 #endif
00053 #ifndef M_LN10
00054 # define M_LN10 2.30258509299404568402
00055 #endif
00056 #ifndef M_PI
00057 # define M_PI 3.14159265358979323846
00058 #endif
00059 #ifndef M_PI_2
00060 # define M_PI_2 1.57079632679489661923
00061 #endif
00062 #ifndef M_PI_4
00063 # define M_PI_4 0.78539816339744830962
00064 #endif
00065 #ifndef M_1_PI
00066 # define M_1_PI 0.31830988618379067154
00067 #endif
00068 #ifndef M_2_PI
00069 # define M_2_PI 0.63661977236758134308
00070 #endif
00071 #ifndef M_2_SQRTPI
00072 # define M_2_SQRTPI 1.12837916709551257390
00073 #endif
00074 #ifndef M_SQRT2
00075 # define M_SQRT2 1.41421356237309504880
00076 #endif
00077 #ifndef M_SQRT1_2
00078 # define M_SQRT1_2 0.70710678118654752440
00079 #endif
00080
00081 #ifdef __cplusplus
00082 extern "C" {
00083 #endif
00084
00085 #if defined(_WIN32)
00086 # define isnan _isnan
00087 extern PI_API int isinf(double);
00088 extern PI_API double rint(double x);
00089
00090 _CRTIMP int __cdecl rand(void);
00091 static __inline double drand48() {
00092 return (double) rand();
00093 }
00094
00095 #elif defined(__STRICT_ANSI__)
00096
00097 # define rint pi_rint
00098 # define isnan pi_isnan
00099
00100 extern PI_API int pi_isnan(double) __PI_THROW;
00101 extern PI_API int isinf(double) __PI_THROW;
00102
00103 extern PI_API double pi_rint(double) __PI_THROW;
00104 #endif
00105
00106 #ifdef __cplusplus
00107 }
00108 #endif
00109
00110 #endif