OSDefines.hxx

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2001-2004 MUSIC TECHNOLOGY GROUP (MTG)
00003  *                         UNIVERSITAT POMPEU FABRA
00004  *
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  *
00020  */
00021 
00022 #ifndef _OSDefines_
00023 #define _OSDefines_
00024 
00025 
00026 #include "CLAM_Math.hxx"
00027 
00028 
00029 # define M_1_2PI         0.15915494309189533577  /* 1/(2pi) */
00030 
00031 #if defined _MSC_VER
00032 
00033 #ifndef _USE_MATH_DEFINES
00034 
00035 // Standard constants not in MSVC
00036 # define M_E            2.7182818284590452354   /* e */
00037 # define M_LOG2E        1.4426950408889634074   /* log_2 e */
00038 # define M_LOG10E       0.43429448190325182765  /* log_10 e */
00039 # define M_LN2          0.69314718055994530942  /* log_e 2 */
00040 # define M_LN10         2.30258509299404568402  /* log_e 10 */
00041 # define M_PI           3.14159265358979323846  /* pi */
00042 # define M_PI_2         1.57079632679489661923  /* pi/2 */
00043 # define M_PI_4         0.78539816339744830962  /* pi/4 */
00044 # define M_1_PI         0.31830988618379067154  /* 1/pi */
00045 # define M_2_PI         0.63661977236758134308  /* 2/pi */
00046 # define M_2_SQRTPI     1.12837916709551257390  /* 2/sqrt(pi) */
00047 # define M_SQRT2        1.41421356237309504880  /* sqrt(2) */
00048 # define M_SQRT1_2      0.70710678118654752440  /* 1/sqrt(2) */
00049 
00050 #endif
00051 
00052 #endif
00053 
00054 /* The above constants are not adequate for computation using `long double's.
00055    Therefore we provide as an extension constants with similar names as a
00056    GNU extension.  Provide enough digits for the 128-bit IEEE quad.  */
00057 # define M_El           2.7182818284590452353602874713526625L  /* e */
00058 
00059 // MRJ: 
00060 #if defined(__GNUC__) && (__GNUC__<3)
00061 # define M_LOG2El       1.4426950408889634073599246810018922L  /* log_2 e */
00062 #endif
00063 
00064 # define M_LOG10El      0.4342944819032518276511289189166051L  /* log_10 e */
00065 # define M_LN2l         0.6931471805599453094172321214581766L  /* log_e 2 */
00066 # define M_LN10l        2.3025850929940456840179914546843642L  /* log_e 10 */
00067 # define M_PIl          3.1415926535897932384626433832795029L  /* pi */
00068 # define M_PI_2l        1.5707963267948966192313216916397514L  /* pi/2 */
00069 # define M_PI_4l        0.7853981633974483096156608458198757L  /* pi/4 */
00070 # define M_1_PIl        0.3183098861837906715377675267450287L  /* 1/pi */
00071 # define M_2_PIl        0.6366197723675813430755350534900574L  /* 2/pi */
00072 # define M_2_SQRTPIl    1.1283791670955125738961589031215452L  /* 2/sqrt(pi) */
00073 # define M_SQRT2l       1.4142135623730950488016887242096981L  /* sqrt(2) */
00074 # define M_SQRT1_2l     0.7071067811865475244008443621048490L  /* 1/sqrt(2) */
00075 
00076 
00077 
00078 #ifndef PI
00079         # define PI M_PIl
00080 #endif
00081 
00082 #ifndef TWO_PI
00083 # define TWO_PI (PI*2.)
00084 #endif
00085 
00086 #ifndef NULL
00087         #define NULL (0L)
00088 #endif
00089 
00090 
00091 #endif
00092 
Generated by  doxygen 1.6.3