Cyclone Cyclone: C:/data/physeng_code/include/cyclone/precision.h Source File

C:/data/physeng_code/include/cyclone/precision.h

Go to the documentation of this file.
00001 /*
00002  * Interface file for code that changes when the core's precision is
00003  * altered.
00004  * 
00005  * Part of the Cyclone physics system.
00006  * 
00007  * Copyright (c) Icosagon 2003. All Rights Reserved.
00008  *
00009  * This software is distributed under licence. Use of this software
00010  * implies agreement with all terms and conditions of the accompanying
00011  * software licence.
00012  */
00013 
00025 #ifndef CYCLONE_PRECISION_H
00026 #define CYCLONE_PRECISION_H
00027 
00028 #include <float.h>
00029 
00031 namespace cyclone {
00032 
00034 #if 0
00035 
00039     #define SINGLE_PRECISION
00040 
00042 
00047     typedef float real;
00049 
00051     #define REAL_MAX FLT_MAX
00052 
00054 
00055     #define real_sqrt sqrtf
00058 
00059     #define real_abs fabsf
00062 
00063     #define real_sin sinf
00064 
00066     #define real_cos cosf
00067 
00069     #define real_exp expf
00072 
00073     #define real_pow powf
00074 
00075 
00077         #define real_fmod fmodf
00078 
00079     #define R_PI 3.14159f
00080 #else
00081 
00082     #define DOUBLE_PRECISION
00083     typedef double real;
00084     #define REAL_MAX DBL_MAX
00085     #define real_sqrt sqrt
00086     #define real_abs fabs
00087     #define real_sin sin
00088     #define real_cos cos
00089     #define real_exp exp
00090     #define real_pow pow
00091         #define real_fmod fmod
00092     #define R_PI 3.14159265358979
00093 
00094 #endif
00095 
00096 }
00098 
00099 #endif // CYCLONE_PRECISION_H