Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vs_math.h
Go to the documentation of this file.
1 /*
2  * Vega Strike
3  * Copyright (C) 2001-2002 Daniel Horn
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  * Portions of this code from Tux Racer by Jasmin F. Patry www.tuxracer.com
19  */
20 
21 #ifndef _VS_MATH_H_
22 #define _VS_MATH_H_
23 
24 #include <config.h>
25 
26 #include "macosx_math.h"
27 #include <math.h>
28 #include <float.h>
29 
30 #ifdef HAVE_IEEEFP_H
31  #include <ieeefp.h>
32 #endif
33 
34 #ifndef M_PI
35  #define M_PI 3.14159265358979323846
36 #endif
37 #ifndef PI
38  #define PI M_PI
39 #endif
40 #ifndef M_1_PI
41  #define M_1_PI (1/M_PI)
42 #endif
43 
44 #if defined (HAVE_MATH_H)
45  #include <math.h>
46 #endif
47 #if defined (HAVE_FINITE) || defined (BSD)
48  #define FINITE( x ) ( finite( x ) )
49  #define ISNAN( x ) ( isnan( x ) )
50 #else
51  #define FINITE( x ) ( _finite( x ) )
52  #define ISNAN( x ) ( _isnan( x ) )
53 #endif
54 
55 #endif // _VS_MATH_H_