PIPS
pipsdef.h
Go to the documentation of this file.
1 /* Header automatically inserted by PYPS for defining MAX, MIN, MOD and others
2  *
3  * Notes:
4  *
5  * 1. This may not be the behavior intended by the programmer.
6  *
7  * 2. MIN and MAX do not always have only two arguments.
8  *
9  * To be reviewed when intrinsics are dealt better in PIPS (FI, 19 April 2015)
10  */
11 #ifndef __PIPS__ /* for PIPS re entrance */
12 #ifndef MAX0
13 # define MAX0(a, b) ((a) > (b) ? (a) : (b))
14 #endif
15 
16 #ifndef MAX
17 # define MAX(a, b) ((a) > (b) ? (a) : (b))
18 #endif
19 
20 #ifndef pips_max
21 # define pips_max(n, a, b) ((a) > (b) ? (a) : (b))
22 #endif
23 
24 #ifndef MIN
25 # define MIN(a, b) ((a) < (b) ? (a) : (b))
26 #endif
27 
28 #ifndef pips_min
29 # define pips_min(n, a, b) ((a) > (b) ? (a) : (b))
30 #endif
31 
32 #ifndef MOD
33 # define MOD(a, b) ((a) % (b))
34 #endif
35 
36 #ifndef DBLE
37 # define DBLE(a) ((double)(a))
38 #endif
39 
40 #ifndef INT
41 # define INT(a) ((int)(a))
42 #endif
43 
44 #ifdef WITH_TRIGO
45 # include <math.h>
46 # ifndef COS
47 # define COS(a) (cos(a))
48 # endif
49 
50 # ifndef SIN
51 # define SIN(a) (sin(a))
52 # endif
53 #endif
54 #endif